Skip to main content
POST
/
apps
/
batch
curl -X POST \
  -H "Authorization: Bearer sk_workspace_test_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 7f3c9a1e-2b4d-4e6f-8a0c-1d2e3f4a5b6c" \
  -d '{
    "items": [
      { "name": "Acme Corp", "redirectUris": ["https://acme.example.com/callback"], "idempotencyKey": "customer-001" },
      { "name": "Beta Ltd",  "redirectUris": ["https://beta.example.com/callback"],  "idempotencyKey": "customer-002" },
      { "name": "Gamma Inc", "idempotencyKey": "customer-003" }
    ],
    "continueOnError": true
  }' \
  "https://sandbox.api.hopae.com/connect/v1/apps/batch"
{
  "results": [
    {
      "app": {
        "clientId": "HqTRDIYH",
        "clientSecret": "sh_app_...",
        "name": "Acme Corp",
        "redirectUris": ["https://acme.example.com/callback"],
        "webhookConfig": { "enabled": false, "retryAttempts": 3, "timeoutSeconds": 10, "events": [] }
      },
      "idempotencyKey": "customer-001"
    },
    {
      "app": {
        "clientId": "MkPQRSTU",
        "clientSecret": "sh_app_...",
        "name": "Beta Ltd",
        "redirectUris": ["https://beta.example.com/callback"],
        "webhookConfig": { "enabled": false, "retryAttempts": 3, "timeoutSeconds": 10, "events": [] }
      },
      "idempotencyKey": "customer-002"
    },
    {
      "app": {
        "clientId": "VwXYZ123",
        "clientSecret": "sh_app_...",
        "name": "Gamma Inc",
        "redirectUris": [],
        "webhookConfig": { "enabled": false, "retryAttempts": 3, "timeoutSeconds": 10, "events": [] }
      },
      "idempotencyKey": "customer-003"
    }
  ],
  "successCount": 3,
  "errorCount": 0
}
Creates up to 100 apps in one call. Useful for resellers provisioning apps for multiple customers.
Store clientSecret securely. Each results[].app.clientSecret is also available via GET /apps/{clientId}, but we recommend persisting it at creation time. Use Rotate Client Secret to issue a new one if needed.
When continueOnError is false (default), the first item failure aborts the batch and no further items are processed. Set continueOnError: true to process all items independently and collect both successes and errors in the response.

Request

Authorization
string
required
Bearer <API_KEY> from Console > Developers > Workspace API Keys.
Content-Type
string
application/json
Idempotency-Key
string
Optional client-generated string (max 255 chars) to safely retry without creating duplicate batches. Scoped per workspace. A key is valid for 24 hours. If the same key is replayed with an identical body, the original response is returned with an Idempotency-Replayed: true header. Reusing the same key with a different body returns 409 IDEMPOTENCY_KEY_CONFLICT.

Request Body

items
object[]
required
Array of app definitions to create.
continueOnError
boolean
default:"false"
When true, processing continues after an item failure. Failed items appear in results with an error object. When false (default), the first failure aborts the batch.

Response

Returns a batch result object.
results
object[]
One entry per input item, in order.
successCount
number
Number of items created successfully.
errorCount
number
Number of items that failed.
curl -X POST \
  -H "Authorization: Bearer sk_workspace_test_..." \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: 7f3c9a1e-2b4d-4e6f-8a0c-1d2e3f4a5b6c" \
  -d '{
    "items": [
      { "name": "Acme Corp", "redirectUris": ["https://acme.example.com/callback"], "idempotencyKey": "customer-001" },
      { "name": "Beta Ltd",  "redirectUris": ["https://beta.example.com/callback"],  "idempotencyKey": "customer-002" },
      { "name": "Gamma Inc", "idempotencyKey": "customer-003" }
    ],
    "continueOnError": true
  }' \
  "https://sandbox.api.hopae.com/connect/v1/apps/batch"
{
  "results": [
    {
      "app": {
        "clientId": "HqTRDIYH",
        "clientSecret": "sh_app_...",
        "name": "Acme Corp",
        "redirectUris": ["https://acme.example.com/callback"],
        "webhookConfig": { "enabled": false, "retryAttempts": 3, "timeoutSeconds": 10, "events": [] }
      },
      "idempotencyKey": "customer-001"
    },
    {
      "app": {
        "clientId": "MkPQRSTU",
        "clientSecret": "sh_app_...",
        "name": "Beta Ltd",
        "redirectUris": ["https://beta.example.com/callback"],
        "webhookConfig": { "enabled": false, "retryAttempts": 3, "timeoutSeconds": 10, "events": [] }
      },
      "idempotencyKey": "customer-002"
    },
    {
      "app": {
        "clientId": "VwXYZ123",
        "clientSecret": "sh_app_...",
        "name": "Gamma Inc",
        "redirectUris": [],
        "webhookConfig": { "enabled": false, "retryAttempts": 3, "timeoutSeconds": 10, "events": [] }
      },
      "idempotencyKey": "customer-003"
    }
  ],
  "successCount": 3,
  "errorCount": 0
}