Connectors

Complete OAuth authorization

Exchange an OAuth authorization code for an encrypted connector.

post/v1/oauth/{provider}/callback

Request

  • Base URL: https://api.sprites.dev
  • URL: https://api.sprites.dev/v1/oauth/{provider}/callback
  • Auth: HTTP bearer

Path parameters

providerstring required

Request body

codestring required

Authorization code returned by the provider.

redirect_uristring

Redirect URI used to create the authorization URL.

statestring

State value from the authorize response.

Example request

{
  "access_policy": {
    "allowed_endpoints": [
      "/chat.*"
    ],
    "blocked_endpoints": [
      "/admin.*"
    ],
    "name_prefix": "prod-",
    "sprite_labels": [
      "api-access"
    ]
  },
  "code": "oauth-code",
  "redirect_uri": "https://api.sprites.dev/v1/oauth/slack/callback",
  "state": "opaque-state"
}

Response

Created

Example response

{
  "connection": {
    "access_policy": {
      "allowed_endpoints": [
        "/chat.*"
      ],
      "blocked_endpoints": [
        "/admin.*"
      ],
      "name_prefix": "prod-",
      "sprite_labels": [
        "api-access"
      ]
    },
    "connection_type": "oauth",
    "id": "conn_abc123",
    "inserted_at": "2026-04-28T12:00:00Z",
    "notes": [
      {
        "title": null,
        "body": "Full-access key."
      }
    ],
    "provider": "slack",
    "provider_account_id": "T12345",
    "provider_account_name": "Example Workspace",
    "provider_info": {
      "team_domain": "example"
    },
    "scopes": "chat:write,channels:read",
    "token_expires_at": "2026-04-29T12:00:00Z",
    "updated_at": "2026-04-29T12:00:00Z",
    "usage_snippet": "curl https://api.sprites.dev/v1/gateway/slack/conn_abc123/auth.test",
    "user_id": "user_abc123"
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.