# IBM API Connect temporary access

Issue a separate client ID and secret for each lease on an existing API Connect
application. Calls run in the existing [customer provisioner](/docs/guides/provisioner),
using either push or outbound-only polling with the same deployment token.

## Connect the application

In **Temporary access → Add target**, select **IBM API Connect** and your provisioner.
Enter the platform API HTTPS origin, provider organization, catalog, consumer
organization, and application names or IDs. These identify one existing application;
the provisioner does not create organizations, applications or subscriptions.
For a private CA, paste its PEM certificate in the optional CA field.

Supply the management credential as JSON with `apiKey`, `clientId`, and `clientSecret`
from the platform's API-key/toolkit setup. It needs `app:view:all` and `app:manage:all`
access to the selected application. The browser encrypts the credential and settings
to the provisioner. Private platform endpoints are supported with verified TLS.

## Lease lifecycle

Each lease creates a named application credential and returns its client ID and
secret encrypted to the requester. Its permissions come from the application's
existing subscriptions. The adapter refuses to overwrite an existing credential.

Cleanup locates the lease credential by its deterministic name, checks its ownership
metadata, and deletes its immutable ID. The application and other credentials are
retained. This also recovers cleanup after a provisioner restart without local state.

API Connect credentials have no native lease expiry. Seekrit queues deletion at the
lease deadline, so the provisioner must remain connected for cleanup. Tokens already
issued using a client credential can follow their own expiry rules.

## CLI and API

Register with `seekrit dynamic target add --name partner-api --config target.json`,
piping the management credential JSON on stdin:

```json
{
  "provider": "ibm-api-connect",
  "executor": "remote",
  "provisionerId": "prv_REPLACE_WITH_REGISTERED_ID",
  "settings": {
    "endpoint": "https://platform-api.example.com",
    "organization": "provider-org",
    "catalog": "sandbox",
    "consumerOrganization": "partner-team",
    "application": "partner-app"
  },
  "maxTtlSeconds": 3600
}
```

Use `seekrit dynamic lease <target-id> --ttl 1h` to request credentials. The existing
lease API accepts `provider: "ibm-api-connect"`. Members and service tokens use their
existing signing keys and granted access; no extra provisioner configuration is needed.

The adapter uses the catalog-scoped application-credential endpoints in
[IBM's API Connect REST reference](https://apic-api.apiconnect.ibmcloud.com/v10/).
