Quickstart

Step-by-step guide to making your first requests to the Ours Privacy REST API, with examples for listing, creating, and managing resources.

Quickstart

This guide walks you through making your first API calls. You'll need an API key — see Authentication if you haven't created one yet.

All examples use curl. Replace YOUR_API_KEY with your actual key.


List Your Destinations

curl https://app.oursprivacy.com/rest/v1/destinations \
  -H "Authorization: Bearer YOUR_API_KEY"

Response:

{
  "data": [
    {
      "id": "dest_abc123",
      "name": "Google Analytics",
      "type": "google-analytics-4",
      "enabled": true
    }
  ]
}

Get a Single Resource

Append the resource ID to the URL:

curl https://app.oursprivacy.com/rest/v1/destinations/dest_abc123 \
  -H "Authorization: Bearer YOUR_API_KEY"

Create a Resource

Send a POST request with a JSON body:

curl https://app.oursprivacy.com/rest/v1/sources \
  -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Marketing Website",
    "type": "web"
  }'

Update a Resource

Send a PATCH request with only the fields you want to change:

curl https://app.oursprivacy.com/rest/v1/destinations/dest_abc123 \
  -X PATCH \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "enabled": false
  }'

Delete a Resource

curl https://app.oursprivacy.com/rest/v1/destinations/dest_abc123 \
  -X DELETE \
  -H "Authorization: Bearer YOUR_API_KEY"

URL Pattern

All resources follow the same pattern:

ActionMethodURL
List allGET/rest/v1/{resource}
Get oneGET/rest/v1/{resource}/{id}
CreatePOST/rest/v1/{resource}
UpdatePATCH/rest/v1/{resource}/{id}
DeleteDELETE/rest/v1/{resource}/{id}

Replace {resource} with: destinations, sources, allowed-events, consent-settings, global-dispatch-centers, replay-settings, or versions.


Error Handling

The API returns standard HTTP status codes:

StatusMeaning
200Success
400Invalid request body or malformed JSON
401Missing or invalid API key
403Insufficient API key scope
404Resource not found
405Action not supported for this resource
500Internal error

Error responses include a message describing what went wrong:

{
  "error": {
    "status": 403,
    "message": "API key does not have the required scope for this resource"
  }
}

OpenAPI Specification

The full OpenAPI spec is available at:

GET https://app.oursprivacy.com/rest/v1/openapi.json

This endpoint is public and does not require authentication. Use it to generate clients, explore the schema, or import into tools like Postman.


What's Next

The API is in beta — more resources and capabilities are on the way, including data APIs and auto-generated SDKs. Check back for updates, or reach out to support@oursprivacy.com to request specific endpoints.

How is this guide?

On this page