ContentStudio
Dark mode
REST API Quickstart

REST API Quickstart

Make your first ContentStudio API request

Use the REST API to manage ContentStudio resources from your application or backend. This quickstart authenticates a request, retrieves your user context, lists your workspaces, and prepares you to create a draft post.

Before you begin

You need a ContentStudio account and an API key.

  1. In ContentStudio, open Settings → API Keys.

  2. Generate an API key and copy it immediately.

  3. Store the key in a server-side secret manager or environment variable. Never expose it in browser code, source control, screenshots, or client-side applications.

Authentication

Send the API key with every request in the X-API-Key header.

export CONTENTSTUDIO_API_KEY="cs_your_api_key_here"

Step 1: Verify your connection

curl -H "X-API-Key: $CONTENTSTUDIO_API_KEY" \
  https://api.contentstudio.io/api/v1/me

A successful response confirms that the key is valid and returns the authenticated user context.

Step 2: List your workspaces

Most ContentStudio API operations are scoped to a workspace. Save the workspace identifier returned by this call.

curl -H "X-API-Key: $CONTENTSTUDIO_API_KEY" \
  https://api.contentstudio.io/api/v1/workspaces

Step 3: List connected social accounts

Replace <workspace_id> with the identifier from the previous response.

curl -H "X-API-Key: $CONTENTSTUDIO_API_KEY" \
  https://api.contentstudio.io/api/v1/workspaces/<workspace_id>/accounts

Step 4: Create a draft post

Use a draft first while validating your integration. Replace the example account IDs and scheduling fields with values supported by your workspace and connected platforms.

curl -X POST \
  -H "X-API-Key: $CONTENTSTUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  https://api.contentstudio.io/api/v1/workspaces/<workspace_id>/posts \
  -d '{
    "content": {
      "text": "Hello from the ContentStudio API!"
    },
    "accounts": ["<account_id>"],
    "scheduling": {
      "publish_type": "draft"
    }
  }'

Common errors

Status

Meaning

Next action

401

API key is missing or invalid

Create or copy a valid key and send it in X-API-Key.

403

The key lacks access to the requested resource

Confirm the workspace and account belong to the authorized user.

404

The requested resource was not found

Recheck the workspace, account, or post identifier.

429

Request limit exceeded

Reduce request frequency and retry according to the documented limit policy.

400

Validation error

Verify required fields and platform-specific post requirements.

Next steps

  • Read Authentication and API keys for secure key lifecycle guidance.

  • Read Posts, approvals, and comments before building publishing workflows.

  • Use Identity and workspaces to understand workspace-scoped resources.

This is a draft. Validate request and response schemas against the current API implementation before publication.

Was this article helpful?