Connector state

Get a connector's access token

Returns an access token for the provider the connector signed in to, good for at least five minutes, with its expiry and scopes. Only the key its connector host minted gets an answer.

POST
/connectors/{id}/access-token

Authorization

bearerAuth
headerAuthorizationBearer <token>

Authenticate with an API key (marfa_k1_…) or an OAuth access token (marfa_at_…).

Path parameters

id*string

The ID of the connector.

Response body

About errors

Returns the access token, its expiry and its scopes.

application/json
  1. response

A short-lived access token for the provider a plugin's connector signed in to.

access_token*string

The provider's access token for the connector's sign-in. Send it to the provider as a bearer token. Don't keep it past expires_at.

expires_at*string

When the access token stops working, in UTC. It is at least five minutes after the answer.

Formatdate-time
scopes*array<string>

The scopes the provider reported for the access token. Empty when the provider reported none.

  • validation_error: the query has a parameter this endpoint doesn't take.
application/json
  1. response

An error response.

error*

What went wrong.

unauthorized: the request has no credential, or its credential is not valid. For a key that has expired, details.expired_at says when it expired.

application/json
  1. response

An error response.

error*

What went wrong.

  • forbidden: your credential isn't the connector's own key. No other key, app or permission gets its access token.
application/json
  1. response

An error response.

error*

What went wrong.

  • connector_not_found: no connector has this ID, or its key isn't one a connector host minted for a plugin's connector.
application/json
  1. response

An error response.

error*

What went wrong.

  • connector_sign_in_not_declared: no sign_in is declared.
  • connector_sign_in_settings_missing: the client ID or secret isn't readable; details.settings names each.
  • connector_not_signed_in: the owner hasn't signed in yet.
  • connector_sign_in_required: the provider refused the sign-in; details.reason says why.
  • instance_changed: X-Marfa-Instance-Id names another instance.
application/json
  1. response

An error response.

error*

What went wrong.

contract_mismatch: X-Marfa-Contract names another contract version than this instance speaks, or is not a whole number. Nothing was done.

application/json
  1. response

An error response.

error*

What went wrong.

rate_limited: you sent too many requests. Wait for the number of seconds in Retry-After, then try again.

application/json
  1. response

An error response.

error*

What went wrong.

internal_error: Marfa failed in a way it didn't expect, and the request may not have completed. Read what you changed before you repeat a write.

application/json
  1. response

An error response.

error*

What went wrong.

  • connector_sign_in_unavailable: the provider didn't answer in time or gave no access token. details.reason is an outcome word such as timeout or status_503. Nothing changed. Try again after Retry-After.
  • write_contention: the database was busy, and Marfa couldn't complete the request in time. Nothing changed. Try the request again.
application/json
  1. response

An error response.

error*

What went wrong.

insufficient_storage: the disk that holds the instance's data has no room for the request, or the request would leave less free than the instance keeps in reserve. Nothing changed, unless details.write_outcome is unknown, which means the write may have landed: read what you changed before you repeat it. Free space on the disk, then try the request again.

application/json
  1. response

An error response.

error*

What went wrong.

curl -X POST 'http://localhost:8600/connectors/string/access-token'
About errors
{  "access_token": "ya29.a0AfH6SMBexample",  "expires_at": "2026-11-22T10:30:00.000Z",  "scopes": [    "https://www.googleapis.com/auth/drive.readonly"  ]}