Skip to content

Create a resource connection

Request

Beta
OAuth 2.0 scope:
  • okta.aiAgents.manage
Admin roles:
  • SUPER_ADMIN

Creates a resource connection for the AI agent

Note: If you're not subscribed to Okta for AI Agents and use XAA as part of SSO, resource connections of type IDENTITY_ASSERTION_APP_INSTANCE are limited to 250 ID-JAG tokens per user, per resource app, per month. For the purposes of this limit, a "User" must be a licensed "User of Single Sign-On in an Active Status," and the total number of XAA users can't exceed the org's total purchased SSO users. If you require higher token volumes, contact your Okta account team to subscribe to Okta for AI Agents.

Path
agentIdstringrequired

ID of the agent

Example:wlpkhjm0jnDp8RrUu0g4
Bodyapplication/jsonrequired
authorizationServerobjectrequired

Reference to a custom authorization server and its configuration

connectionTypestringrequired

Identity assertion connection for custom authorization servers

Value:"IDENTITY_ASSERTION_CUSTOM_AS"
Discriminator
resourceIndicatorstring, (uri)(ResourceConnectionResourceIndicator)

Resource indicator used when requesting tokens

scopeConditionstring(ScopeCondition)required

Determines how Okta evaluates requested scopes for the connection

Enum ValueDescription
ALL_SCOPES

All scopes are evaluated as part of the connection. For this condition, the scopes array must contain a single value of * to indicate all scopes.

INCLUDE_ONLY

Only the scopes specified in scopes are evaluated as part of the connection

EXCLUDE

All scopes except those specified in scopes are evaluated as part of the connection

scopesArray of strings, non-empty(ConnectionScopes)required

Array of scopes. Required for all scopeCondition values.

curl -i -X POST \
  https://subdomain.okta.com/workload-principals/api/v1/ai-agents/wlpkhjm0jnDp8RrUu0g4/connections \
  -H 'Content-Type: application/json' \
  -d '{
    "connectionType": "IDENTITY_ASSERTION_CUSTOM_AS",
    "resourceIndicator": "https://api.crm.company.com",
    "authorizationServer": {
      "orn": "orn:okta:idp:00o5rb5mt2H3d1TJd0h7:authorization_servers:aus5rb5mt2H3d1TJd0h7"
    },
    "scopeCondition": "EXCLUDE",
    "scopes": [
      "crm.admin.delete",
      "crm.admin.write"
    ]
  }'

Responses

A successful connection created response

Bodyapplication/json
authorizationServerobject(ResourceConnectionCustomAuthorizationServer)required

Custom authorization server for the resource connection

connectionTypestringrequired

Type of connection authentication method

Value:"IDENTITY_ASSERTION_CUSTOM_AS"
Discriminator
idstring(ResourceConnectionId)required

Unique identifier for the resource connection. Only present for resource connections.

ornstring(ResourceConnectionOrn)required

The ORN of the resource connection

resourceIndicatorstring, (uri)(ResourceConnectionResourceIndicator)required

Resource indicator used when requesting tokens

scopeConditionstring(ScopeCondition)

Determines how Okta evaluates requested scopes for the connection

Enum ValueDescription
ALL_SCOPES

All scopes are evaluated as part of the connection. For this condition, the scopes array must contain a single value of * to indicate all scopes.

INCLUDE_ONLY

Only the scopes specified in scopes are evaluated as part of the connection

EXCLUDE

All scopes except those specified in scopes are evaluated as part of the connection

scopesArray of strings, non-empty(ConnectionScopes)

Array of scopes. Required for all scopeCondition values.

statusstring(ResourceConnectionStatus)required

The status of the connection

Enum ValueDescription
ACTIVE

The agent connection is active

INACTIVE

The agent connection is inactive

Response
{ "connectionType": "IDENTITY_ASSERTION_CUSTOM_AS", "id": "mcn5e6f7g8h9i0j1k2l3", "orn": "orn:okta:idp:00o1n8sbwArJ7OQRw406:connections:mcn5e6f7g8h9i0j1k2l3", "status": "ACTIVE", "resourceIndicator": "https://api.custom-crm.com", "authorizationServer": { "orn": "orn:okta:idp:00o1n8sbwArJ7OQRw406:authorization_servers:aus5t60iloOHN9pBi0h7", "name": "Custom CRM Authorization Server", "issuerUrl": "https://{yourOktaDomain}/oauth2/aus5t60iloOHN9pBi0h7", "_links": { … } }, "scopeCondition": "INCLUDE_ONLY", "scopes": [ "crm.contacts.read", "crm.accounts.write" ], "_links": { "self": { … } } }