Skip to main content
An agent registration creates a persistent identity in your org. No credentials are issued at registration — you issue them separately after the agent is registered.

Dashboard

Developers → Agents → Register an agent
FieldRequiredDescription
Display nameYesHuman-readable name, unique within your org. 2–64 characters.
CapabilitiesNoShort descriptive tags (e.g. chart-review, scheduling-handoff). Up to 12 tags, 32 chars each.
Default expiryYesDefault expiry for credentials issued to this agent. 1 hour to 30 days.
Default revocation policyYesdrain or kill. Used when issuing a credential without an explicit policy.
Allowed scope typesNoScope types that credentials issued to this agent may carry. Leave blank to allow all scope types. Agents blocked from a scope type cannot receive credentials with that scope regardless of who is issuing.
After registration, you land on the agent detail page which links directly to issuing the first credential.

API

POST https://api.usehasp.com/v1/agents
Authorization: Bearer hasp_key_live_...
Content-Type: application/json

Body

{
  "name": "IntakeRouter",
  "capabilities": ["chart-review", "scheduling-handoff"],
  "default_expiry_hours": 8,
  "default_revocation_policy": "drain",
  "allowed_scope_types": [
    "hasp.data.read",
    "hasp.data.write",
    "external.tool.invoke"
  ]
}

Fields

FieldTypeRequiredDescription
namestringYesUnique display name within the org. 2–64 chars.
capabilitiesstring[]NoDescriptive tags. Max 12, 32 chars each.
default_expiry_hoursintegerYes1–720.
default_revocation_policydrain | killYesDefault policy for newly issued credentials.
allowed_scope_typesstring[] | nullNoScope type allowlist. null permits all scope types.
descriptionstringNoOptional long-form description.

Response

{
  "success": true,
  "data": {
    "agent": {
      "id": "01JQAGENT0000000000000000",
      "name": "IntakeRouter",
      "capabilities": ["chart-review", "scheduling-handoff"],
      "default_expiry_hours": 8,
      "default_revocation_policy": "drain",
      "allowed_scope_types": ["hasp.data.read", "hasp.data.write", "external.tool.invoke"],
      "status": "active",
      "created_at": "2026-05-11T12:00:00+00:00"
    }
  }
}

Errors

CodeHTTPMeaning
AGENT_NAME_TAKEN422An active agent with this name already exists in your org.
INVALID_SCOPE_TYPE422allowed_scope_types contains an unrecognized scope type.

Listing agents

GET https://api.usehasp.com/v1/agents
Authorization: Bearer hasp_key_live_...

Query parameters

ParameterDescription
statusactive (default), archived, or all.
searchFilter by name or ID prefix.
pagePage number.
per_pageResults per page (default 25, max 100).

Response

{
  "success": true,
  "data": [
    {
      "id": "01JQAGENT0000000000000000",
      "name": "IntakeRouter",
      "capabilities": ["chart-review"],
      "status": "active",
      "active_credential_count": 2,
      "created_at": "2026-05-11T12:00:00+00:00"
    }
  ],
  "meta": {
    "total": 1,
    "page": 1,
    "last_page": 1
  }
}

Retrieving a single agent

GET https://api.usehasp.com/v1/agents/{agent_id}
Authorization: Bearer hasp_key_live_...

Updating agent settings

PATCH https://api.usehasp.com/v1/agents/{agent_id}
Authorization: Bearer hasp_key_live_...
Content-Type: application/json
Updatable fields: name, description, capabilities, default_expiry_hours, default_revocation_policy, allowed_scope_types. Emits agent.metadata_updated on any actual change.

Archiving an agent

Archiving immediately revokes all active credentials (with kill policy) and prevents new credentials from being issued.
POST https://api.usehasp.com/v1/agents/{agent_id}/archive
Authorization: Bearer hasp_key_live_...
Returns the IDs of all revoked credentials. Archived agents can be reactivated:
POST https://api.usehasp.com/v1/agents/{agent_id}/reactivate
Authorization: Bearer hasp_key_live_...
Reactivation does not restore previously revoked credentials.