Approve an agent request - Spacefast Docs

Approve an agent request

Approves a pending request and returns the receipt the waiting agent redeems. Requires a signed-in session belonging to the grant’s owner. Approving again returns the same receipt, and an elevation returns its lease.

Endpoint

POST /v1/approvals/{approvalId}/approve

Authorization

__Host-better-auth.session_token

API key · cookie required

Dashboard session cookie set at sign-in. An operation that lists only this scheme needs a person: API keys and machine credentials are refused. The same session token also works as Authorization: Bearer.

Path parameters

Responses

  {
    "$schema": "string<uri>",
    "data": {
      "id": "string",
      "status": "string"  // Allowed: "completed", "denied", "expired"
    }
  }

Every 4xx and 5xx response is one RFC 9457 problem document served as application/problem+json.

  {
    "$schema": "string<uri>",
    "type": "string",
    "title": "string",
    "status": integer,  // HTTP status of the response
    "detail": "string",
    "code": "string",
    "pointer": "string",
    "details": {
      "property1": null,
      "property2": null
    },
    "suggestions": ["string"],
    "next": ["string"],
    "requestId": "string"
  }

Try it

Request examples

cURL

curl -X POST "https://api.spacefast.com/v1/approvals/string/approve" \
  -H "Cookie: __Host-better-auth.session_token=YOUR_API_KEY"

JavaScript

const response = await fetch("https://api.spacefast.com/v1/approvals/string/approve", {
  method: "POST",
  headers: {
    "Cookie": "__Host-better-auth.session_token=YOUR_API_KEY"
  }
});

Python

import requests

response = requests.post(
    "https://api.spacefast.com/v1/approvals/string/approve",
    headers={
        "Cookie": "__Host-better-auth.session_token=YOUR_API_KEY"
    },
)

Response Example

Success Response (200)

{
  "$schema": "http://example.com",
  "data": {
    "id": "string",
    "status": "completed",
    "result": {
      "property1": null,
      "property2": null
    }
  }
}

Error Response

{
  "$schema": "http://example.com",
  "type": "string",
  "title": "string",
  "status": -9007199254740991,
  "detail": "string",
  "code": "string",
  "pointer": "string",
  "details": {
    "property1": null,
    "property2": null
  },
  "suggestions": ["string"],
  "next": ["string"],
  "requestId": "string"
}