# Get what a Profile's credential can do

`GET https://api.koil.co/v1/profiles/{profileId}/capabilities`

Get what a Profile's credential can do: each of its platform's collections with the operations, events and backfill the credential's scopes cover, and each of its account settings with the operations the credential covers. Where the platform restricts the profile further (a Facebook Page role, a WhatsApp number that cannot message yet), what it leaves out is declined as `platform_profile_restricted`; Koil asks the platform on each read, and shows the grant's answer when the platform cannot answer.

## Authorization

An API key from the Koil admin console, sent as `Authorization: Bearer <key>`. A live key starts `koil_live_` and a sandbox key `koil_sandbox_`; the key alone selects the Organization and mode. See https://docs.koil.co/concepts/authentication.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `Koil-Version` | header | yes | `"2026-12-01"` | The dated API version the request is written against; it fixes the request and response shapes. Every response echoes the version it is rendered in. |
| `profileId` | path | yes | string |  |

## Example

```bash
curl -X GET "https://api.koil.co/v1/profiles/{profileId}/capabilities" \
  -H "Authorization: Bearer $KOIL_API_KEY" \
  -H "Koil-Version: 2026-12-01"
```

## Response 200

What the Koil Profile's credential can do: its collections, each narrowed to its credential and to what the platform permits the profile.

- `profileId` (string, required) (min length 1): Koil Profile identifier.
- `collections` (array of object, required): The platform's collections, as `GET /v1/collections` lists them, narrowed to this profile's credential: an operation or backfill the credential cannot run is `supported: false` with the reason, and `emits` holds only the events Koil can collect for the profile.
  - `collection` (string, required) (min length 1): `{platform}.{surface}.{resource}`: `instagram.media.comments`.
  - `platformId` (string, required) (min length 1)
  - `surfaceId` (string, required) (min length 1)
  - `resourceId` (string, required) (min length 1)
  - `description` (string)
  - `schemaRef` (string, required): The item: what reads return and events carry as `data`. A JSON Pointer into the OpenAPI document.
  - `operations` (array of object, required): Every verb, offered or not.
    - `verb` (one of `"list"`, `"get"`, `"resolve_attachment"`, `"publish"`, `"update"`, `"perform_action"`, `"delete"`, required)
    - `supported` (boolean, required)
    - `description` (string)
    - `reason` (one of `"platform_not_supported"`, `"platform_no_endpoint"`, `"platform_no_webhook"`, `"not_applicable"`, `"not_implemented"`, `"webhook_only"`, `"scope_insufficient"`, `"resource_ref_missing"`, `"issuer_unsupported"`, `"platform_profile_restricted"`): Why not: the platform does not offer it, this profile's credential cannot run it (`scope_insufficient`, `resource_ref_missing`, `issuer_unsupported`), or the platform restricts this profile from it (`platform_profile_restricted`: a Facebook Page role without the task, a WhatsApp number that cannot message yet).
    - `detail` (string) (min length 1)
    - `missingScopes` (array of string): With `scope_insufficient`: the scopes the credential lacks. Re-authorize the Connection with them.
    - `credentials` (array of object, required): The credentials that run it, any one of which suffices; empty when the platform does not offer it.
      - `type` (string, required) (min length 1)
      - `issuerId` (string, required) (min length 1)
      - `source` (one of `"connection"`, `"profile"`, `"app"`, `"key"`, required): Whose credential: `connection` (the Connection's token, however its method obtained it), `profile` (minted for the Profile when it was connected, such as a Facebook Page token), `app` (your App's own client), or `key` (a brand's key, which only an issuer's own calls take).
      - `scopes` (array of string, required)
      - `resourceRefs` (array of string, required)
    - `inputRef` (string): For `publish`: the publish request item this collection takes, its `args` included. A JSON Pointer into the OpenAPI document.
    - `actions` (array of object): For `perform_action`: each action the collection declares, offered or not.
      - `action` (one of `"hide"`, `"unhide"`, `"like"`, `"unlike"`, `"approve"`, `"hold"`, `"reject"`, `"ban_author"`, `"seen"`, `"typing_on"`, `"typing_off"`, required): What to do with the item: `hide` (hide it from public view), `unhide` (show a hidden item again), `like` (like it as the profile), `unlike` (remove the profile's like), `approve` (publish it, clearing a hold or rejection), `hold` (hold it for review), `reject` (reject it, removing it from public view), `ban_author` (reject it and block its author from the profile), `seen` (show the person a read receipt for their messages), `typing_on` (show the person that the profile is typing), `typing_off` (stop showing that the profile is typing).
      - `supported` (boolean, required)
      - `reason` (one of `"platform_not_supported"`, `"platform_no_endpoint"`, `"platform_no_webhook"`, `"not_applicable"`, `"not_implemented"`, `"webhook_only"`): Why the platform does not offer it.
      - `detail` (string) (min length 1)
    - `variants` (array of object): For `publish`, where the item's `variant` decides its `args`.
      - `variant` (string, required) (min length 1)
      - `inputRef` (string, required): The publish request item of this variant. A JSON Pointer into the OpenAPI document.
  - `emits` (array of one of `"created"`, `"updated"`, `"deleted"`, `"moderated"`, required): The actions of its events: it emits `content.{collection}.{action}` for each.
  - `backfill` (object, required)
    - `supported` (boolean, required)
    - `coverage` (one of `"complete"`, `"bounded"`, `"partial"`): How a run reaches `since`: the platform filters by it (`complete`), the listing is newest first so the run stops there (`bounded`), or the listing promises no order and the run reads all of it (`partial`).
    - `reason` (one of `"platform_not_supported"`, `"platform_no_endpoint"`, `"platform_no_webhook"`, `"not_applicable"`, `"not_implemented"`, `"webhook_only"`, `"scope_insufficient"`, `"resource_ref_missing"`, `"issuer_unsupported"`, `"platform_profile_restricted"`): Why not: the platform does not offer it, this profile's credential cannot run it (`scope_insufficient`, `resource_ref_missing`, `issuer_unsupported`), or the platform restricts this profile from it (`platform_profile_restricted`: a Facebook Page role without the task, a WhatsApp number that cannot message yet).
    - `detail` (string) (min length 1)
    - `missingScopes` (array of string): With `scope_insufficient`: the scopes the credential lacks. Re-authorize the Connection with them.
- `settings` (array of object, required): The platform's account settings, such as a Messenger greeting, narrowed to this profile's credential in the same way.
  - `setting` (string, required) (min length 1): `{platform}.{setting}`: `facebook.dm_welcome`. Read and set it at `/v1/profiles/{profileId}/settings/{setting}`.
  - `platformId` (string, required) (min length 1)
  - `description` (string, required)
  - `schemaRef` (string, required): The setting: what `get` and `update` return, and the fields `update` takes. A JSON Pointer into the OpenAPI document.
  - `operations` (array of object, required)
    - `verb` (one of `"get"`, `"update"`, required)
    - `supported` (boolean, required)
    - `description` (string)
    - `reason` (one of `"scope_insufficient"`, `"resource_ref_missing"`, `"issuer_unsupported"`): Why this profile's credential cannot run it.
    - `detail` (string) (min length 1)
    - `missingScopes` (array of string): With `scope_insufficient`: the scopes the credential lacks. Re-authorize the Connection with them.
    - `credentials` (array of object, required): The credentials that run it, any one of which suffices.
      - `type` (string, required) (min length 1)
      - `issuerId` (string, required) (min length 1)
      - `source` (one of `"connection"`, `"profile"`, `"app"`, `"key"`, required): Whose credential: `connection` (the Connection's token, however its method obtained it), `profile` (minted for the Profile when it was connected, such as a Facebook Page token), `app` (your App's own client), or `key` (a brand's key, which only an issuer's own calls take).
      - `scopes` (array of string, required)
      - `resourceRefs` (array of string, required)

## Errors

Every error has the same shape: `{ "error": { "code", "message", "meta", "requestId" } }`. [Errors →](https://docs.koil.co/concepts/errors)

| Status | Meaning |
| --- | --- |
| 400 | `validation_error`: The request does not match the operation's input schema, fails an admission check, or the platform refused its content. `meta.violations` names every problem. `not_supported`: The platform, collection or resource does not offer this operation, such as exporting a `key` Connection's credential, which Koil never returns. |
| 401 | `unauthorized`: No API key, or a key Koil does not accept (unknown, revoked, or with a prefix that does not match its mode). |
| 403 | `permission_denied`: The API key is valid but lacks a permission the operation requires; `meta.required` names it. Use a key created with that permission. `scope_insufficient`: The credential lacks a scope the operation needs; `meta` names the missing scopes. `connection_invalid`: The platform credential behind the Profile no longer works; the end user must re-authorize. |
| 404 | `not_found`: The resource does not exist in this Organization and mode. |
| 409 | `conflict`: The request collides with current state: an idempotency key reused with a different payload or still in flight, a run already in progress, a publish that has already started, or a resource that already exists (`meta.resourceType` and `meta.resourceId` name it). Retry only when the response carries `Retry-After` (the key's first request is still in flight), after that many seconds. |
| 429 | `rate_limit_exceeded`: Koil's own rate limit for the key, Organization, Profile, or client address is spent (`meta.budgets` names which); retry after `Retry-After` seconds. `platform_rate_limit`: The platform throttled the call or the platform quota is spent; retry after `Retry-After` seconds. |
| 500 | `internal`: Koil or the platform failed, and the status says which: 500 when Koil failed, including a platform refusing how Koil made the call; 502 when the platform failed or answered something Koil cannot use; 504 when Koil's call to the platform timed out. The message is generic; retry with backoff. |
| 502 | `internal`: Koil or the platform failed, and the status says which: 500 when Koil failed, including a platform refusing how Koil made the call; 502 when the platform failed or answered something Koil cannot use; 504 when Koil's call to the platform timed out. The message is generic; retry with backoff. |
| 503 | `service_unavailable`: A service Koil needs to accept the request (API key validation or rate limiting) is unavailable. Nothing was attempted; retry after `Retry-After` seconds. |
| 504 | `internal`: Koil or the platform failed, and the status says which: 500 when Koil failed, including a platform refusing how Koil made the call; 502 when the platform failed or answered something Koil cannot use; 504 when Koil's call to the platform timed out. The message is generic; retry with backoff. |
| default | Any other failure. `error.code` names it; the HTTP status follows from it. |
