Demo Modern
ResourcesAPI Examples
Resources

API Examples

Copy-ready requests, responses, and integration patterns.

Abstract network connections
This demo reference shows how teams can combine narrative guidance, parameter tables, and executable examples on one page.

Create a project

bash
curl --request POST \
  --url https://api.example.com/v1/projects \
  --header 'Authorization: Bearer YOUR_TOKEN' \
  --header 'Content-Type: application/json' \
  --data '{"name":"Knowledge Hub","region":"eu"}'

Request body

FieldTypeRequiredDescription
namestringYesHuman-readable project name
regionstringNoHosting region; defaults to us
visibilitystringNoEither private or public

Example response

json
{
  "id": "prj_8f31a2",
  "name": "Knowledge Hub",
  "region": "eu",
  "status": "ready",
  "created_at": "2026-08-05T07:00:00Z"
}

Status codes

CodeMeaningRecommended action
201Project createdStore the returned project ID
400Invalid requestCheck fields and value formats
401Authentication failedRefresh or replace the token
429Rate limit reachedRetry with exponential backoff
Never place production API tokens in client-side code, screenshots, or documentation examples.

JavaScript example

javascript
const response = await fetch('https://api.example.com/v1/projects', {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.API_TOKEN}`,
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({ name: 'Knowledge Hub', region: 'eu' }),
});

const project = await response.json();
console.log(project.id);