### GET /api/agents Source: https://www.clawcard.sh/docs Retrieve a list of all API keys (agents) associated with the authenticated user. ```APIDOC ## GET /api/agents ### Description List all API keys for the authenticated user. ### Method GET ### Endpoint /api/agents ### Response #### Success Response (200) - **id** (string) - Unique agent identifier - **name** (string) - Friendly name - **email** (string) - Provisioned email address - **phone** (string) - Provisioned phone number #### Response Example [ { "id": "agt_abc123", "name": "my-agent", "email": "inbox-7xk@mail.clawcard.sh", "phone": "+12025551234" } ] ``` -------------------------------- ### GET /api/agents/{id} Source: https://www.clawcard.sh/docs Fetch detailed information for a specific agent by ID. ```APIDOC ## GET /api/agents/{id} ### Description Get details for a specific API key. ### Method GET ### Endpoint /api/agents/{id} ### Parameters #### Path Parameters - **id** (string) - Required - The agent ID to retrieve ### Response #### Success Response (200) - **id** (string) - Agent ID - **status** (string) - Current status of the agent #### Response Example { "id": "agt_abc123", "status": "active" } ``` -------------------------------- ### GET /api/agents/{id}/activity Source: https://www.clawcard.sh/docs Retrieves a list of recent activities performed by or for the specified agent. ```APIDOC ## GET /api/agents/{id}/activity ### Description List recent activity for this key. ### Method GET ### Endpoint /api/agents/{id}/activity ### Parameters #### Path Parameters - **id** (string) - Required - The agent ID. #### Query Parameters - **limit** (number) - Optional - Maximum number of results to return (default: 50). ### Request Example ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/activity ``` ### Response #### Success Response (200) - **activity** (array) - A list of activity objects. - **id** (string) - The activity ID. - **action** (string) - The type of action performed (e.g., "card:create"). - **details** (object) - Additional details about the action. - **createdAt** (string) - The timestamp when the activity occurred (ISO 8601 format). #### Response Example ```json { "activity": [ { "id": "act_abc123", "action": "card:create", "details": "{\"memo\":\"Domain purchase\",\"amountCents\":2000}", "createdAt": "2026-03-08T12:00:00.000Z" }, { "id": "act_def456", "action": "email:send", "details": "{\"to\":\"user@example.com\",\"subject\":\"Hello\"}", "createdAt": "2026-03-08T11:55:00.000Z" } ] } ``` #### Action types `email:receive`, `email:send`, `sms:receive`, `sms:send`, `card:create`, `card:read`, `card:pause`, `card:resume`, `card:close`, `creds:write` ``` -------------------------------- ### GET /api/agents/{id}/cards/{cardId} Source: https://www.clawcard.sh/docs Retrieves details for a specific card associated with an agent. ```APIDOC ## GET /api/agents/{id}/cards/{cardId} ### Description Retrieves details for a specific card associated with an agent. ### Method GET ### Endpoint /api/agents/{id}/cards/{cardId} ### Parameters #### Path Parameters - **id** (string) - Required - The agent ID. - **cardId** (string) - Required - The card ID. ### Request Example ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/cards/card_abc123 ``` ### Response #### Success Response (200) - **id** (string) - The card ID. - **pan** (string) - The primary account number. - **cvv** (string) - The card verification value. - **exp_month** (integer) - The expiration month. - **exp_year** (integer) - The expiration year. - **lastFour** (string) - The last four digits of the PAN. - **type** (string) - The card type (e.g., "single_use"). - **memo** (string) - A description for the card. - **spendLimitCents** (integer) - The spending limit in cents. - **status** (string) - The current status of the card (e.g., "open"). #### Response Example ```json { "id": "card_abc123", "pan": "5412753400124242", "cvv": "321", "exp_month": 12, "exp_year": 2029, "lastFour": "4242", "type": "single_use", "memo": "Domain purchase", "spendLimitCents": 2000, "status": "open" } ``` ``` -------------------------------- ### GET /api/agents/{id}/emails Source: https://www.clawcard.sh/docs List emails in the agent's inbox with optional filtering. ```APIDOC ## GET /api/agents/{id}/emails ### Description List emails in the inbox. Supports filtering by read status, sender, and subject. ### Method GET ### Endpoint /api/agents/{id}/emails ### Parameters #### Path Parameters - **id** (string) - Required - The agent ID #### Query Parameters - **unread** (boolean) - Optional - Filter to unread only - **from** (string) - Optional - Filter by sender email address - **subject_contains** (string) - Optional - Search subject line - **limit** (number) - Optional - Max results, 1-100 (default: 20) ### Request Example curl -H "Authorization: Bearer $CLAWCARD_API_KEY" "https://clawcard.sh/api/agents/agt_abc123/emails?unread=true&limit=10" ### Response #### Success Response (200) - **id** (string) - Email ID - **sender** (string) - Sender address - **recipient** (string) - Recipient address - **subject** (string) - Email subject - **body** (string) - Plain text body - **html** (string) - HTML body - **isRead** (boolean) - Read status - **direction** (string) - Inbound/Outbound - **createdAt** (string) - Timestamp #### Response Example [ { "id": "em_abc123", "sender": "support@example.com", "recipient": "inbox-7xk@mail.clawcard.sh", "subject": "Welcome!", "body": "Thanks for signing up...", "html": "
Thanks for signing up...
", "isRead": false, "direction": "inbound", "createdAt": "2026-03-08T12:00:00.000Z" } ] ``` -------------------------------- ### Get Virtual Card Details (API) Source: https://www.clawcard.sh/docs Retrieves full details of a specific virtual card, including PAN and CVV. This endpoint requires the agent ID and the card ID, along with API key authentication. ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/cards/card_abc123 ``` -------------------------------- ### POST /api/agents Source: https://www.clawcard.sh/docs Create a new API key and provision associated resources for an AI agent. ```APIDOC ## POST /api/agents ### Description Create a new API key. Returns the raw key once — store it securely. ### Method POST ### Endpoint /api/agents ### Parameters #### Request Body - **name** (string) - Optional - Friendly name (default: "default") ### Request Example { "name": "my-agent" } ### Response #### Success Response (200) - **id** (string) - Agent ID - **apiKey** (string) - The raw API key (only returned once) #### Response Example { "id": "agt_newkey123", "apiKey": "ak_live_..." } ``` -------------------------------- ### Create Virtual Card (API) Source: https://www.clawcard.sh/docs Creates a new virtual Mastercard for an agent with a specified spending limit and type. Full card details are returned only upon creation. Requires sufficient budget and cardsEnabled: true. ```bash curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"amountCents":2000,"memo":"Domain purchase"}' \ https://clawcard.sh/api/agents/agt_abc123/cards ``` -------------------------------- ### Retrieve Activity Log Source: https://www.clawcard.sh/docs Fetches a chronological audit trail of actions performed by the agent, such as card creation or email/SMS events. Supports pagination via the limit parameter. ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/activity ``` -------------------------------- ### POST /api/agents/{id}/cards Source: https://www.clawcard.sh/docs Create a new virtual Mastercard for the agent. ```APIDOC ## POST /api/agents/{id}/cards ### Description Create a new virtual card. Full card details (PAN, CVV, expiry) are returned only at creation. ### Method POST ### Endpoint /api/agents/{id}/cards ### Parameters #### Request Body - **amountCents** (number) - Required - Spending limit in cents - **type** (string) - Optional - "single_use" or "merchant_locked" - **memo** (string) - Optional - Card description ### Request Example { "amountCents": 2000, "memo": "Domain purchase" } ### Response #### Success Response (200) - **id** (string) - Card ID - **pan** (string) - Card number - **cvv** (string) - CVV code - **exp_month** (number) - Expiry month - **exp_year** (number) - Expiry year #### Response Example { "id": "card_xyz789", "pan": "5412753400124242", "cvv": "321", "exp_month": 12, "exp_year": 2029 } ``` -------------------------------- ### Manage Agent API Keys Source: https://www.clawcard.sh/docs Endpoints for listing, creating, retrieving, updating, and deleting agent API keys. These keys serve as the foundation for agent identity and resource provisioning. ```cURL curl -H "Authorization: Bearer $CLAWCARD_API_KEY" https://clawcard.sh/api/agents ``` ```cURL curl -X POST -H "Authorization: Bearer $CLAWCARD_API_KEY" -H "Content-Type: application/json" -d '{"name": "my-agent"}' https://clawcard.sh/api/agents ``` ```cURL curl -H "Authorization: Bearer $CLAWCARD_API_KEY" https://clawcard.sh/api/agents/agt_abc123 ``` ```cURL curl -X PATCH -H "Authorization: Bearer $CLAWCARD_API_KEY" -H "Content-Type: application/json" -d '{"cardsEnabled": false}' https://clawcard.sh/api/agents/agt_abc123 ``` ```cURL curl -X DELETE -H "Authorization: Bearer $CLAWCARD_API_KEY" https://clawcard.sh/api/agents/agt_abc123 ``` -------------------------------- ### List Virtual Cards (API) Source: https://www.clawcard.sh/docs Retrieves a list of all virtual cards associated with a specific agent. This endpoint requires an API key for authentication. ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/cards ``` -------------------------------- ### Budget API Source: https://www.clawcard.sh/docs Manage the budget allocated to an agent's key, controlling spending limits on virtual cards. ```APIDOC ## Budget API ### Description Allocate funds from your account balance to a key's spending budget. Budget controls how much the key can spend on virtual cards. ### GET /api/agents/{id}/budget #### Description Get the current budget for this key. #### Method GET #### Endpoint /api/agents/{id}/budget #### Parameters ##### Path Parameters - **id** (string) - Required - The agent ID. #### Request Example ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/budget ``` #### Response ##### Success Response (200) - **budgetCents** (integer) - The current budget in cents. ##### Response Example ```json { "budgetCents": 5000 } ``` ### POST /api/agents/{id}/budget #### Description Allocate funds from your account balance to this key's budget. Requires sufficient account balance. Top up your balance from the dashboard settings page. #### Method POST #### Endpoint /api/agents/{id}/budget #### Parameters ##### Path Parameters - **id** (string) - Required - The agent ID. ##### Request Body - **amountCents** (number) - Required - Amount to allocate in cents (min: 100). #### Request Example ```bash curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"amountCents": 2000}' \ https://clawcard.sh/api/agents/agt_abc123/budget ``` #### Response ##### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **balanceRemainingCents** (integer) - The remaining account balance in cents. - **agentBudgetCents** (integer) - The updated agent budget in cents. ##### Response Example ```json { "success": true, "balanceRemainingCents": 8000, "agentBudgetCents": 7000 } ``` ``` -------------------------------- ### List Emails (API) Source: https://www.clawcard.sh/docs Retrieves a list of emails from an agent's inbox. Supports filtering by read status, sender, and subject. Requires an API key for authentication. ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ "https://clawcard.sh/api/agents/agt_abc123/emails?unread=true&limit=10" ``` -------------------------------- ### Send Email (API) Source: https://www.clawcard.sh/docs Sends an email from an agent's dedicated email address. Requires recipient, subject, and body content. Authentication is handled via an API key. ```bash curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"to":"user@example.com","subject":"Hello","body":"Hi there!"}' \ https://clawcard.sh/api/agents/agt_abc123/emails/send ``` -------------------------------- ### Manage Agent Budget Source: https://www.clawcard.sh/docs Allows checking the current spending budget for an agent and allocating additional funds from the account balance. Minimum allocation is 100 cents. ```bash # Get budget curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/budget # Allocate funds curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"amountCents": 2000}' \ https://clawcard.sh/api/agents/agt_abc123/budget ``` -------------------------------- ### Manage Agent Credentials Source: https://www.clawcard.sh/docs Provides endpoints to list, create, update, and retrieve encrypted credentials for services like OpenAI or Stripe. Values are stored securely and decrypted upon retrieval. ```bash # List credentials curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/credentials # Create/Update credential curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"service":"openai","key":"api_key","value":"sk-..."}' \ https://clawcard.sh/api/agents/agt_abc123/credentials # Retrieve credential curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/credentials/openai/api_key ``` -------------------------------- ### Create Virtual Credit Cards Source: https://www.clawcard.sh/docs Issues a new Mastercard for a specific agent with defined spend limits. Requires a valid agent ID and authorization. ```cURL curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"amountCents": 2000, "memo": "Domain purchase"}' \ https://clawcard.sh/api/agents/agt_abc123/cards ``` -------------------------------- ### Credentials API Source: https://www.clawcard.sh/docs Manage encrypted credentials for your agents, including storing, retrieving, and listing them. ```APIDOC ## Credentials API ### Description Encrypted key-value vault for storing API keys and secrets your agent needs at runtime. ### GET /api/agents/{id}/credentials #### Description List stored credentials (names only, values not returned). #### Method GET #### Endpoint /api/agents/{id}/credentials #### Parameters ##### Path Parameters - **id** (string) - Required - The agent ID. #### Request Example ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/credentials ``` #### Response ##### Success Response (200) - **service** (string) - The name of the service. - **key** (string) - The key name for the credential. ##### Response Example ```json [ { "service": "openai", "key": "api_key" }, { "service": "stripe", "key": "secret_key" } ] ``` ### POST /api/agents/{id}/credentials #### Description Store or update an encrypted credential. #### Method POST #### Endpoint /api/agents/{id}/credentials #### Parameters ##### Path Parameters - **id** (string) - Required - The agent ID. ##### Request Body - **service** (string) - Required - Service name (e.g. "openai"). - **key** (string) - Required - Credential key (e.g. "api_key"). - **value** (string) - Required - Secret value (encrypted at rest). #### Request Example ```bash curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"service":"openai","key":"api_key","value":"sk-..."}' \ https://clawcard.sh/api/agents/agt_abc123/credentials ``` #### Response ##### Success Response (200) - **success** (boolean) - Indicates if the operation was successful. - **service** (string) - The service name. - **key** (string) - The credential key. ##### Response Example ```json { "success": true, "service": "openai", "key": "api_key" } ``` ### GET /api/agents/{id}/credentials/{service}/{key} #### Description Retrieve a decrypted credential value. #### Method GET #### Endpoint /api/agents/{id}/credentials/{service}/{key} #### Parameters ##### Path Parameters - **id** (string) - Required - The agent ID. - **service** (string) - Required - The service name. - **key** (string) - Required - The credential key. #### Request Example ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/credentials/openai/api_key ``` #### Response ##### Success Response (200) - **service** (string) - The service name. - **key** (string) - The credential key. - **value** (string) - The decrypted credential value. ##### Response Example ```json { "service": "openai", "key": "api_key", "value": "sk-..." } ``` ``` -------------------------------- ### List SMS Messages (API) Source: https://www.clawcard.sh/docs Retrieves a list of SMS messages sent and received by an agent. Supports limiting the number of results. Requires an API key for authentication. ```bash curl -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/sms ``` -------------------------------- ### POST /api/agents/{id}/emails/send Source: https://www.clawcard.sh/docs Send an email from the agent's email address. ```APIDOC ## POST /api/agents/{id}/emails/send ### Description Send an email from the key's email address. ### Method POST ### Endpoint /api/agents/{id}/emails/send ### Parameters #### Request Body - **to** (string) - Required - Recipient email address - **subject** (string) - Required - Email subject line - **body** (string) - Required - Email body ### Request Example { "to": "user@example.com", "subject": "Hello", "body": "Hi there!" } ### Response #### Success Response (200) - **id** (string) - Email ID - **from** (string) - Sender address - **to** (string) - Recipient address #### Response Example { "id": "em_xyz789", "from": "inbox-7xk@mail.clawcard.sh", "to": "user@example.com", "subject": "Hello from my agent", "createdAt": "2026-03-08T12:00:00.000Z" } ``` -------------------------------- ### Mark Email as Read (API) Source: https://www.clawcard.sh/docs Marks a specific email in an agent's inbox as read. This action is performed via a POST request to the email's endpoint. Authentication is required. ```bash curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ https://clawcard.sh/api/agents/agt_abc123/emails/em_abc123/read ``` -------------------------------- ### Send SMS (API) Source: https://www.clawcard.sh/docs Sends an SMS message from an agent's assigned phone number. Requires the recipient's phone number in E.164 format and the message body. Authentication is handled via an API key. ```bash curl -X POST \ -H "Authorization: Bearer $CLAWCARD_API_KEY" \ -H "Content-Type: application/json" \ -d '{"to":"+15551234567","body":"Hello from my agent!"}' \ https://clawcard.sh/api/agents/agt_abc123/sms/send ``` -------------------------------- ### Authenticate API Requests Source: https://www.clawcard.sh/docs All API requests must include a Bearer token in the Authorization header. The token is generated via the dashboard and should be stored securely. ```HTTP Authorization: Bearer