Integration notes
A few cross-cutting facts that will save you time when building against the API.
Server-to-server only
Section titled “Server-to-server only”The REST API does not send CORS headers, so browsers will block calls made directly from a web page. Call the API from your backend, and never ship a Personal Access Token to the client.
No idempotency keys
Section titled “No idempotency keys”The API has no idempotency mechanism. Re-sending an execute request that already succeeded creates a duplicate run (and duplicate cost). To recover from a dropped response, prefer polling the existing run over re-submitting, and only retry submits you’re certain didn’t land. See Async jobs.
No webhooks
Section titled “No webhooks”There is no way to register a callback for run completion — poll instead, on the returned poll_interval_seconds. See Async jobs & polling.
Versioning
Section titled “Versioning”The API is path-versioned under /v1. See Versioning.
Collections
Section titled “Collections”An API request collection is available for Postman and Bruno, with a folder per resource — handy for exploring endpoints and building requests.
Quick reference
Section titled “Quick reference”| Topic | Value |
|---|---|
| Base URL | https://api.app.layer.ai/api |
| Version prefix | /v1 |
| Auth | Authorization: Bearer pat_… |
| Errors | RFC 7807 application/problem+json |
| Pagination | cursor (limit ≤ 100) |
| Async | 202 + poll (poll_interval_seconds) |