Skip to content

Creating APIs

Creating your APIs is fast and easy from the attainable dashboard, or using the public API.

From the editor, follow these steps:

  1. Create an API.
  2. Give the API a name and choose a size.
  3. Deploy!

Using the public API, follow these steps:

  1. Create an API Key.
  2. Replace <API_KEY> with yours in the curl command below.
  3. Deploy!
Terminal window
curl --request POST \
--url https://api.attainable.dev/apis/ \
--header 'Authorization: Bearer <API_KEY>' \
--header 'Content-Type: application/yaml' \
--data 'name: My First API
config:
plan: micro
data:
users:
email: string
team: < teams
preferences:
color: string
teams:
name: string
users: << users';

And here is an example of the response you’ll receive:

{
"name": "My First API",
"plan": "micro",
"base_url": "https://grand-canyon-4321.attainable.dev",
"docs_url": "https://grand-canyon-4321.attainable.dev/docs",
"default_key": "<API_KEY>"
}

Using the URLs provided in the response, you can begin using your API with the provided default_key value as your Authentication token.