Skip to content

Using APIs

Your APIs can be used with familiar RESTful CRUD endpoints. Using the example in Creating APIs, the following commands can be used against your API. Read about the Resource Description and how that maps to RESTful endpoints for more information.

In the examples below <API_KEY> represents the value you received when creating the API.

Here is an example of a POST request to create a resource.

curl --request POST \
--url https://grand-canyon-4321.attainable.dev/users \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \
--data '{ "email": "attainable.developer@example.com" }'

And this is an example of the response for that request.

{
"email": "attainable.developer@example.com",
"id": 1
}

This example shows a GET request to list the users resources.

curl --request GET \
--url https://grand-canyon-4321.attainable.dev/users \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \

And this is an example of the response for that request.

[
{
"createdat": "2025-12-24T22:18:42Z",
"email": "attainable.developer@example.com",
"id": 1,
"preferences": null,
"team": null,
"updatedat": "2025-12-24T22:18:42Z"
}
]

Single resources can be requested with an example this. Notice the additional path /users/1 added to the URL to identify the single resource.

curl --request GET \
--url https://grand-canyon-4321.attainable.dev/users/1 \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/json' \

And this is an example of that response.

{
"createdat": "2025-12-24T22:18:42Z",
"email": "attainable.developer@example.com",
"id": 1,
"preferences": null,
"team": null,
"updatedat": "2025-12-24T22:18:42Z"
}

The following example shows how to delete single resources. This responds with the HTTP Status code 204 and will have no content.

curl --request DELETE \
--url https://dry-night-8475.attainable.dev/user/1 \
--header 'Authorization: Bearer <API_KEY>'

Each API is provided its own documentation that includes multiple clients and is fully functioning with the API Keys.

Visit the /docs path on your API, and the full URL is also provided in the public API response as docs_url.