Current documentation. Version and compatibility notes.

Automation reference

Customer-server push, messaging, audience, user-binding and release workflows.

Workflow guide · Download OpenAPI JSON

API origin
https://automation.appportal.io
API version
v1
Reference source
8bda8e8302d4ea5bd005ef1132f7267e82e6337c
Download SHA-256
72d3673470d8cd0a0bd99df1fa453b22bbcd4a16e2b00efa55c3ccd66c0009ea

Relative server URLs in this contract refer to the API origin above. Use that origin when importing the document into an API client.

Authentication

ServerCredential
A confidential aps_ credential. Store only in a customer-server secret store.

X-AppPortal-Server-Key (header)

Credentials stay with their intended audience. A browser session, SDK key, upload key and Automation credential grant different access.

Operations

GET/v1/automation/audiences

List saved audiences in the credential's app environment

Whole environment-scoped native audience array in existing name order when at most100 rows qualify. More returns409 pagination_required; never truncated success. Existing ignored query parameters remain ignored. Use /page for continuation.

Access: ServerCredential

Required permission: AudienceRead

Responses

200
Environment-scoped audience definitions
{
  "application/json": {
    "schema": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/components/schemas/AudienceDefinition"
      }
    }
  }
}
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
409
pagination_required: use /v1/automation/audiences/page with limit/cursor.
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/AutomationAudienceProblem"
    }
  }
}
503
automation_audience_page_unavailable: source cannot be confirmed; never empty success.
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/AutomationAudienceProblem"
    }
  }
}

Link to this operation

POST/v1/automation/audiences

Create a saved audience in the credential's app environment

Access: ServerCredential

Required permission: AudienceWrite

Parameters

Idempotency-Key (header, optional)
Resend the same key and input to recover the original audience after a lost response.
{
  "type": "string",
  "maxLength": 200
}

Request body

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/AudienceUpsertRequest"
      }
    }
  }
}

Responses

201
Audience created
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/AudienceDefinition"
    }
  }
}
400
Invalid request or missing idempotency key
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
409
The key was used for another request or storage owner.
503
Retry the original request with the same key.

Link to this operation

DELETE/v1/automation/audiences/{audienceId}

Delete a saved audience

Access: ServerCredential

Required permission: AudienceWrite

Parameters

audienceId (path, required)
{
  "type": "string"
}

Responses

204
Audience deleted
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
404
Audience is outside the credential scope or does not exist

Link to this operation

GET/v1/automation/audiences/{audienceId}

Get one saved audience

Access: ServerCredential

Required permission: AudienceRead

Parameters

audienceId (path, required)
{
  "type": "string"
}

Responses

200
Audience definition
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/AudienceDefinition"
    }
  }
}
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
404
Audience is outside the credential scope or does not exist

Link to this operation

PUT/v1/automation/audiences/{audienceId}

Replace a saved audience

Access: ServerCredential

Required permission: AudienceWrite

Parameters

audienceId (path, required)
{
  "type": "string"
}

Request body

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/AudienceUpsertRequest"
      }
    }
  }
}

Responses

200
Audience updated
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/AudienceDefinition"
    }
  }
}
400
Invalid request or missing idempotency key
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
404
Audience is outside the credential scope or does not exist

Link to this operation

POST/v1/automation/audiences/{audienceId}/estimate

Estimate the current reach of a saved audience

Access: ServerCredential

Required permission: AudienceRead

Parameters

audienceId (path, required)
{
  "type": "string"
}

Responses

200
Current audience estimate
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
404
Audience is outside the credential scope or does not exist

Link to this operation

GET/v1/automation/audiences/page

Read one bounded audience page in the current server credential environment

Same server authority as the legacy read. Strict limit defaults25/range1..100; cursor binds current credential, app/environment, selected data owner and limit. Environment is filtered in SQL before the bound. Immutable audience IDs use PostgreSQL C ascending; separate requests are not a frozen snapshot. Credential authority/network and source owner are checked before response emission. No create/write/send authority is added.

Access: ServerCredential

Required permission: AudienceRead

Parameters

limit (query, optional)
{
  "type": "integer",
  "default": 25,
  "minimum": 1,
  "maximum": 100
}
cursor (query, optional)
Opaque unchanged protected continuation, no whitespace/control characters. Unknown/repeated query keys are invalid.
{
  "type": "string",
  "minLength": 1,
  "maxLength": 8192
}

Responses

200
Current authorized audience page; unknown totalCount remains null.

Response headers

{
  "Cache-Control": {
    "schema": {
      "const": "private, no-store"
    }
  }
}
{
  "application/json": {
    "schema": {
      "$ref": "#/components/schemas/AudiencePage"
    }
  }
}
400
automation_audience_page_invalid: malformed/repeated/unsupported selection or mismatched continuation.
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/AutomationAudienceProblem"
    }
  }
}
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
429
Current account/key request budget exceeded; honor Retry-After.
503
automation_audience_page_unavailable: selected data owner unavailable or changed; no rows returned.
{
  "application/problem+json": {
    "schema": {
      "$ref": "#/components/schemas/AutomationAudienceProblem"
    }
  }
}

Link to this operation

POST/v1/automation/push

Send or dry-run an app-scoped push notification

Access: ServerCredential

Required permission: PushSend

Parameters

Idempotency-Key (header, required)
{
  "type": "string",
  "minLength": 1,
  "maxLength": 200
}

Request body

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/AutomationPushRequest"
      }
    }
  }
}

Responses

200
Completed or replayed result
400
Invalid request or missing idempotency key
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
409
Idempotency key is in flight or was reused for another request

Link to this operation

POST/v1/automation/releases/{artifactId}/publish

Publish an uploaded artifact to a release channel

Access: ServerCredential

Required permission: ReleasePublish

Parameters

artifactId (path, required)
{
  "type": "string"
}
Idempotency-Key (header, required)
{
  "type": "string",
  "minLength": 1,
  "maxLength": 200
}

Request body

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/AutomationReleasePublishRequest"
      }
    }
  }
}

Responses

200
Release published or replayed
400
Invalid request or missing idempotency key
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
404
Artifact or channel is outside the credential scope or does not exist
409
Idempotency key is in flight or was reused for another request

Link to this operation

POST/v1/automation/sms

Send or dry-run consented, spend-gated SMS

Access: ServerCredential

Required permission: SmsSend

Parameters

Idempotency-Key (header, required)
{
  "type": "string",
  "minLength": 1,
  "maxLength": 200
}

Request body

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/AutomationSmsRequest"
      }
    }
  }
}

Responses

200
Completed or replayed result
400
Invalid request or missing idempotency key
401
Missing, invalid, revoked, or expired credential
402
Blocked by spend policy
403
Wrong credential class, missing permission, scope violation, or network restriction
409
Idempotency key is in flight or was reused for another request

Link to this operation

POST/v1/automation/user-bindings

Issue a short-lived user/installation binding for an installed app

Access: ServerCredential

Required permission: UserBindingIssue

Request body

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/CreateClientUserBindingRequest"
      }
    }
  }
}

Responses

201
Binding issued; its raw apb_ value is returned once
400
Invalid request or missing idempotency key
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
503
Identity binding authority unavailable

Link to this operation

POST/v1/automation/user-bindings/revoke

Revoke one installation binding or every binding for a user

Access: ServerCredential

Required permission: UserBindingIssue

Request body

{
  "required": true,
  "content": {
    "application/json": {
      "schema": {
        "$ref": "#/components/schemas/RevokeClientUserBindingsRequest"
      }
    }
  }
}

Responses

200
Bindings revoked
400
Invalid request or missing idempotency key
401
Missing, invalid, revoked, or expired credential
403
Wrong credential class, missing permission, scope violation, or network restriction
503
Identity binding authority unavailable

Link to this operation

Declared schemas

Schema references in the operations resolve to these definitions from the same OpenAPI document.

AutomationPushRequest
{
  "type": "object",
  "required": [
    "title",
    "body"
  ],
  "properties": {
    "title": {
      "type": "string",
      "maxLength": 200
    },
    "body": {
      "type": "string",
      "maxLength": 4096
    },
    "userIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "userEmail": {
      "type": [
        "string",
        "null"
      ]
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "platforms": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "locality": {
      "type": [
        "string",
        "null"
      ]
    },
    "deepLink": {
      "type": [
        "string",
        "null"
      ]
    },
    "data": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "ttlSeconds": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 1,
      "maximum": 2419200
    },
    "silent": {
      "type": "boolean"
    },
    "priority": {
      "type": [
        "string",
        "null"
      ],
      "enum": [
        "low",
        "normal",
        "high",
        null
      ]
    },
    "dryRun": {
      "type": "boolean"
    }
  }
}
AutomationSmsRequest
{
  "type": "object",
  "required": [
    "body"
  ],
  "properties": {
    "body": {
      "type": "string",
      "maxLength": 4096
    },
    "userIds": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "userEmail": {
      "type": [
        "string",
        "null"
      ]
    },
    "tags": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      }
    },
    "platforms": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "locality": {
      "type": [
        "string",
        "null"
      ]
    },
    "category": {
      "type": "string",
      "enum": [
        "Marketing",
        "Transactional",
        "Conversational"
      ]
    },
    "dryRun": {
      "type": "boolean"
    }
  }
}
CreateClientUserBindingRequest
{
  "type": "object",
  "required": [
    "userId",
    "installationId"
  ],
  "properties": {
    "userId": {
      "type": "string"
    },
    "installationId": {
      "type": "string"
    },
    "operations": {
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "lifetimeSeconds": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 60,
      "maximum": 86400
    }
  }
}
RevokeClientUserBindingsRequest
{
  "type": "object",
  "required": [
    "userId"
  ],
  "properties": {
    "userId": {
      "type": "string"
    },
    "installationId": {
      "type": [
        "string",
        "null"
      ]
    },
    "reason": {
      "type": [
        "string",
        "null"
      ]
    }
  }
}
AudienceUpsertRequest
{
  "type": "object",
  "required": [
    "name"
  ],
  "properties": {
    "name": {
      "type": "string"
    },
    "userIds": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "platforms": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "tags": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      }
    },
    "locality": {
      "type": [
        "string",
        "null"
      ]
    },
    "environmentName": {
      "type": [
        "string",
        "null"
      ],
      "description": "May be omitted or must equal the aps_ credential environment."
    },
    "minAppVersion": {
      "type": [
        "string",
        "null"
      ]
    },
    "dormantDays": {
      "type": [
        "integer",
        "null"
      ],
      "minimum": 0
    }
  }
}
AudienceDefinition
{
  "type": "object",
  "required": [
    "audienceId",
    "tenantId",
    "appId",
    "name",
    "userIds",
    "platforms",
    "tags",
    "locality",
    "environmentName",
    "minAppVersion",
    "dormantDays"
  ],
  "properties": {
    "audienceId": {
      "type": "string"
    },
    "tenantId": {
      "type": "string"
    },
    "appId": {
      "type": "string"
    },
    "name": {
      "type": "string"
    },
    "userIds": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": "string"
      }
    },
    "platforms": {
      "type": [
        "array",
        "null"
      ],
      "items": {
        "type": [
          "string",
          "integer"
        ]
      },
      "description": "Native AppPlatform serializer values; defined values use their native names, while unknown persisted enum numbers remain numbers."
    },
    "tags": {
      "type": [
        "object",
        "null"
      ],
      "additionalProperties": {
        "type": "string"
      }
    },
    "locality": {
      "type": [
        "string",
        "null"
      ]
    },
    "environmentName": {
      "type": [
        "string",
        "null"
      ]
    },
    "minAppVersion": {
      "type": [
        "string",
        "null"
      ]
    },
    "dormantDays": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int32"
    }
  }
}
AudiencePage
{
  "type": "object",
  "required": [
    "items",
    "nextCursor",
    "totalCount"
  ],
  "properties": {
    "items": {
      "type": "array",
      "maxItems": 100,
      "items": {
        "$ref": "#/components/schemas/AudienceDefinition"
      }
    },
    "nextCursor": {
      "type": [
        "string",
        "null"
      ],
      "description": "Protected source/credential/scope/limit-bound continuation. Null when this read has no following row."
    },
    "totalCount": {
      "type": [
        "integer",
        "null"
      ],
      "format": "int64",
      "description": "Always null: no complete snapshot count is asserted."
    }
  }
}
AutomationAudienceProblem
{
  "type": "object",
  "required": [
    "type",
    "title",
    "status",
    "detail",
    "instance",
    "code",
    "message",
    "error",
    "traceId"
  ],
  "properties": {
    "type": {
      "type": "string"
    },
    "title": {
      "type": "string"
    },
    "status": {
      "type": "integer",
      "minimum": 400,
      "maximum": 599
    },
    "detail": {
      "type": "string"
    },
    "instance": {
      "type": "string"
    },
    "code": {
      "type": "string"
    },
    "message": {
      "type": "string"
    },
    "error": {
      "type": "string"
    },
    "traceId": {
      "type": "string"
    }
  },
  "description": "Native ApiProblemContract from shared ServiceDefaults. instance is an opaque request URN, not a resource URL; code/message/error/detail are server-authored."
}
AutomationReleasePublishRequest
{
  "type": "object",
  "required": [
    "channelId"
  ],
  "properties": {
    "channelId": {
      "type": "string"
    }
  }
}