Browse Developer Tooling

beta · api · 0.1.0

Issue a resource-bound browser grant

POST /api/v1/browser-resource-grants

Capability Domain: Developer Tooling

Authentication

projectCredential (resource-grants:write)

Scope: resource-grants:write

Parameters and request body

  • X-Correlation-ID — header, optional
    X-Correlation-ID schema
    {
        "type": "string",
        "format": "uuid"
    }

Request schema

application/json

application/json request schema
{
    "type": "object",
    "additionalProperties": false,
    "required": [
        "platform_account_id",
        "resource_type",
        "resource_id",
        "actions",
        "origin"
    ],
    "properties": {
        "platform_account_id": {
            "type": "string",
            "format": "uuid"
        },
        "resource_type": {
            "type": "string",
            "maxLength": 120
        },
        "resource_id": {
            "type": "string",
            "maxLength": 255
        },
        "actions": {
            "type": "array",
            "minItems": 1,
            "maxItems": 10,
            "uniqueItems": true,
            "description": "Allowed Project Client scope, optionally followed by one /target qualifier that the consumer must match exactly.",
            "items": {
                "type": "string",
                "maxLength": 120,
                "pattern": "^[a-z][a-z0-9._-]*:[a-z][a-z0-9._-]*(/[a-zA-Z0-9][a-zA-Z0-9._-]*)?$"
            }
        },
        "origin": {
            "type": "string",
            "format": "uri",
            "maxLength": 2048
        }
    }
}

application/json request example

application/json request example
{
    "platform_account_id": "30000000-0000-4000-8000-000000000003",
    "resource_type": "article",
    "resource_id": "article-42",
    "actions": [
        "comments:read",
        "comments:write"
    ],
    "origin": "https://app.example.test"
}

Responses and errors

StatusDescription
201Single-use browser grant
401Invalid or revoked Project Credential
403Project Credential lacks the required scope
422Request violates the public contract

201 schema

201 response schema
{
    "type": "object",
    "required": [
        "data"
    ],
    "properties": {
        "data": {
            "type": "object",
            "required": [
                "token",
                "expires_at"
            ],
            "properties": {
                "token": {
                    "type": "string"
                },
                "expires_at": {
                    "type": "string",
                    "format": "date-time"
                }
            }
        }
    }
}

401 schema

401 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

403 schema

403 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

422 schema

422 response schema
{
    "type": "object",
    "required": [
        "error"
    ],
    "properties": {
        "error": {
            "type": "object",
            "required": [
                "code",
                "message",
                "retryable",
                "correlation_id",
                "details"
            ],
            "properties": {
                "code": {
                    "type": "string"
                },
                "message": {
                    "type": "string"
                },
                "retryable": {
                    "type": "boolean"
                },
                "correlation_id": {
                    "type": "string",
                    "format": "uuid"
                },
                "details": {
                    "type": "object"
                }
            }
        }
    }
}

201 example

201 response example
{
    "data": {
        "token": "0000000000000000000000000000000000000000000000000000000000000000",
        "expires_at": "2026-09-03T02:05:00Z"
    }
}

Idempotency

Each authorization decision issues a new five-minute single-use grant.