REST API

Access your structured prompts via HTTP requests to our REST API. All sections are combined and ready to send to any AI provider.

Base URL

All API requests should be made to:

https://superprompts.app/api/v1

Authentication

All requests require authentication using your project's API key in the request headers:

x-api-key: <YOUR_API_KEY>

Getting Your API Key: Navigate to your project settings in the dashboard to view your API key.

Get Prompt

Retrieve a specific prompt with all sections combined.

Request

curl https://superprompts.app/api/v1/prompts/<PROMPT_ID> \
  -H "x-api-key: <API_KEY>"

Response

{
  "success": true,
  "data": {
    "id": "my-prompt",
    "prompt": "[All sections combined in optimal order]",
    "sections": [
      {
        "id": "task-context",
        "title": "1. Task context",
        "content": "..."
      },
      {
        "id": "tone-context",
        "title": "2. Tone context",
        "content": "..."
      }
    ],
    "tools": [
      {
        "type": "function",
        "function": {
          "name": "search",
          "description": "Search for information",
          "parameters": {
            "type": "object",
            "properties": {
              "query": {
                "type": "string",
                "description": "Search query"
              }
            },
            "required": ["query"]
          }
        }
      }
    ],
    "version": "a1b2c3d",
    "created_at": "2024-01-01T00:00:00Z",
    "updated_at": "2024-01-01T00:00:00Z"
  }
}

Response Fields

successboolean

Indicates whether the request was successful

dataobject

Contains the prompt data (only present on success)

data.idstring

The unique identifier for the prompt

data.promptstring

All sections combined in optimal order, ready to use with AI providers

data.sectionsarray

Individual sections with their IDs, titles, and content

data.toolsarray (optional)

Tools/functions defined for this prompt in OpenAI function calling format

data.versionstring

The current version hash (7-character SHA-256 hash)

data.created_atstring

ISO 8601 timestamp of creation

data.updated_atstring

ISO 8601 timestamp of last update

errorstring (optional)

Error message (only present on failure)

Error Responses

401 Unauthorized

Invalid or missing API key

{
  "success": false,
  "error": "Invalid API key"
}
404 Not Found

Prompt not found

{
  "success": false,
  "error": "Prompt not found"
}
500 Internal Server Error

Server error

{
  "success": false,
  "error": "Internal server error"
}

Next Steps