---
title: "Create Agent OAuth Client"
method: POST
path: "/agents/{id}/oauth-clients"
tags: ["agents-credentials"]
---

# Create Agent OAuth Client

`POST /agents/{id}/oauth-clients`

## Request

- Base URL: `https://api.instruxi.dev/api/v1/enforcer`
- URL: `https://api.instruxi.dev/api/v1/enforcer/agents/{id}/oauth-clients`
- Auth: one of:
  - API key in header `Authorization`
  - API key in header `X-API-Key`

Creates a confidential client_credentials client bound to the agent. The client secret is returned exactly once. allowed_scopes must be covered by the agent's scopes and the caller's own (403 insufficient_scope); an agent or portal credential cannot mint (403 agent_cannot_mint).

## Path parameters

- `id` string, required

## Request body

- InternalDeliveryHttpHandlerCreateAgentOAuthClientRequest
  - `allowed_scopes` string[]
  - `client_name` string

## Response `201`

Created

- InternalDeliveryHttpHandlerIssuedAgentOAuthClientResponse
  - `data` EnforcerV3InternalUsecaseAgentsIssuedOAuthClient
    - `client` EnforcerV3InternalDomainAgentOAuthClient
      - `agent_id` string
      - `allowed_scopes` string[]
      - `client_id` string
      - `client_name` string
      - `created_at` string
      - `disabled_at` string
      - `grant_types` string[]
    - `client_secret` string
  - `success` boolean

## Other responses

- `400`: Bad Request
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Not Found
- `409`: Conflict

---

[API](https://skmtc.dev/instruxi/apis/enforcer-api.md) · [All operations](https://skmtc.dev/instruxi/apis/enforcer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/instruxi/apis/enforcer-api/revisions/fa82bc1becc0?raw)
