List approvals - Spacefast Docs
List approvals
Returns the signed-in user’s own approvals. The pending list ranks elevation requests above routine resumes and then orders by newest; scope=decided returns the 25 most recent receipts instead. Requires a signed-in session.
GET /v1/approvals
Authorization
Authorization Bearer token · header required
Authorization: Bearer <token>
Query parameters
teamIdstring
min length 1scopestring
Allowed:pending,decided
Responses
200 Response for status 200
$schemastring
Canonical JSON Schema URL for this response body.dataobject required
Show propertiesdecisionsobject[] required
Show properties
Array ofobjectidstring required -titlestring required -descriptionstring required -hrefstring required -kindstring required
Allowed:confirmation,elevation,resume-grantIdstring required -rationalestring required -requestedScopesstring[] required -statusstring
Allowed:approved,denied,expired,completed,executing-decidedAtstring| any
-expiresAtstringrequired - createdAtstringrequired
default Error
Every 4xx and 5xx response is one RFC 9457 problem document served as application/problem+json.
$schemastring
Canonical JSON Schema URL for this response body.typestring required
URL of the documentation page for this error.titlestring required
Human-readable name of the error type.statusinteger required
HTTP status of the response, repeated in the body.detailstring required
What went wrong in this request.codestring required
Stable snake_case error code.pointerstring
RFC 6901 JSON Pointer to the request field or batch entry that failed.detailsobjectsuggestionsstring[]
Recovery steps safe to show to a person.nextstring[]
Commands or API requests to run next, usable as written.requestIdstring required
ID of this request, from theX-Request-Idheader or generated.
Try it
Server
Base URL https://api.spacefast.com
Authorization
Bearer token
Parameters
teamIdqueryscopequery — pending, decided
Send
Request
cURL
curl -X GET "https://api.spacefast.com/v1/approvals" \
-H "Authorization: Bearer YOUR_TOKEN"
JavaScript
const response = await fetch("https://api.spacefast.com/v1/approvals", {
method: "GET",
headers: {
"Authorization": "Bearer YOUR_TOKEN"
}
});
Python
import requests
response = requests.get(
"https://api.spacefast.com/v1/approvals",
headers={
"Authorization": "Bearer YOUR_TOKEN"
},
)
Response
200 default
{
"$schema": "http://example.com",
"data": {
"decisions": [
{
"id": "string",
"title": "string",
"description": "string",
"href": "string",
"kind": "confirmation",
"grantId": "string",
"rationale": "string",
"requestedScopes": [
"string"
],
"status": "approved",
"decidedAt": "2019-08-24T14:15:22Z",
"expiresAt": "2019-08-24T14:15:22Z",
"createdAt": "2019-08-24T14:15:22Z"
}
]
}
}
{
"$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"
}