credentials

Request a credential (agent)

Initiates a credential device flow. The agent provides the type and service name, and receives a device_code + user_code. The user code must be shown to the operator (or sent via email, which AgentLair handles automatically). The agent then polls /v1/credentials/poll until the credential is delivered or the request expires (5 minutes).

post/v1/credentials/request

Request

  • Base URL: https://agentlair.dev
  • URL: https://agentlair.dev/v1/credentials/request
  • Auth: HTTP bearer

Request body

credential_type'api_key' | 'password' | 'token' | 'certificate' required

Type of credential being requested

service_namestring required

Name of the service the credential is for

descriptionstring

Optional human-readable description of why the credential is needed

Example request

{
  "service_name": "GitHub",
  "description": "Read access to private repos"
}

Response

Credential request created

device_codestring

Opaque device code used for polling. Keep secret.

user_codestring

Short human-readable code shown to the operator. Format: XXXX-XXXX.

expires_ininteger

Seconds until the request expires

intervalinteger

Recommended polling interval in seconds

messagestring

Human-readable instruction for the agent

Example response

{
  "device_code": "dc_aBcDeFgHiJkLmNoPqRsTuVwXyZ012345678901",
  "user_code": "ABCD-1234",
  "expires_in": 300,
  "interval": 5,
  "message": "Ask operator to visit https://agentlair.dev/v1/credentials/approve?code=ABCD-1234"
}

Changes

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