Alice content API

Content APIs Represents WHAT content was created on your platform, such as a post, comment, review, message, article or data. For example, a web page containing a video, a customer review of a product, a comment and so on.

OpenAPI Specification

alice-content-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  license:
    name: Alice API Terms of Use
    url: https://app.alice.io/ts-platform/api-terms.pdf
  version: 3.0.0
  title: Alice API Documentation content API
  description: "# About This Guide\nThis guide provides comprehensive documentation for Alice's API offerings:\n\n**WonderSuite** - Our GenAI protection suite:\n- **WonderBuild**: Red teaming and security assessment tools for AI applications\n- **WonderFence**: Real-time guardrails for AI-generated content\n\n**ActiveFamily** - Our content moderation platform:\n- **ActiveScore**: AI-driven automated detection API that analyzes items and returns risk scores\n- **ActiveOS**: Self-service UI for organizing items, taking automatic or manual actions, and more\n\nAll APIs use a standard REST design, allowing you to use any standard REST client to call our endpoints from your server.\n\n### Run in Postman\nIf you use Postman, you can import the Alice APIs endpoints as a collection into your Postman app, then try out different requests to learn how the API works. Click the following button to get started:\n\n[![Run in Postman](https://run.pstmn.io/button.svg)](https://god.gw.postman.com/run-collection/24226888-0756580e-fccf-4fc3-8d36-7cc224b9215e?action=collection%2Ffork&collection-url=entityId%3D24226888-0756580e-fccf-4fc3-8d36-7cc224b9215e%26entityType%3Dcollection%26workspaceId%3D4a89e487-a108-4875-9ade-315bd98baf53)\n\n# Authentication\nAn Alice platform account is required to send requests and data to the Alice platform. An Alice representative will open an account for you and send you an email invitation to log in.\n\nThe following describes how to generate an API key, which you must use in the **af-api-key** header of each API request that you send. \n\n\n\n## Generating an API Key – How To\n**To generate an API key –**\n\n1. Click the **Account Settings**  button.\n\n2. Select **DATA MANAGEMENT** and then select **Alice API Keys**. \nA list of the Alice API keys that have already been defined is displayed. \n\n \n3. Click the **Add Key** button. The following displays – \n\n    \n\n4. In the **Key Name** field, enter any free-text name to identify the key.\n\n5. In the **Description** field, enter any free text description of the key.\n\n6. Click the **Generate Key** button. The key is then displayed in the following window – \n\n    \n\n    You must copy the key and should keep it secure, because you will not be able to see it again. Later, if needed you can [regenerate this key](#section/Authentication/Regenerating-a-Key).\n\n7. Click on the key in the **Your API Key** field to copy it to the clipboard. You can now click the **I've copied the key** button.\n\n8. Use this key as the value of an **af-api-key** header that you must add to each request.\n**af-api-key: \"YOUR_API_KEY\"** \n\n ## Regenerating a Key\nRegenerating a key will override the current one. The old one will still be valid for an additional 12 hours. After 12 hours, any request sent with the old key will be rejected.\n\n**To regenerate an Alice API Key –** \n1. Click the **Account Settings**  button. \n2. Select **DATA MANAGEMENT** and then **Alice API Keys**. The following displays – \n\n\n3. Click the **Regenerate**  button on the right side of the API key to be generated.\n\n**Note –** The options to delete a key and/or regenerate an existing one enable you to rotate between two different API keys.\n\n## Editing/Deleting a Key\nOnly the name and description of a key can be edited.\nOnce you delete a key, any request that uses the deleted key will be rejected. \n\n**To delete an Alice API Key –** \n\n1. Click the **Account Settings**  button. \n\n2. Select **DATA MANAGEMENT**, and then **Alice API Keys**. \n\n3. Click the  button on the right side of the API key and select the **Edit** or the **Delete** option.\n"
  contact:
    name: Support
    email: support@alice.io
  termsOfService: https://app.alice.io/ts-platform/terms.pdf
servers:
- url: https://api.alice.io
  description: APIs Server
security:
- API Key: []
tags:
- name: content
  description: Content APIs Represents WHAT content was created on your platform, such as a post, comment, review, message, article or data. For example, a web page containing a video, a customer review of a product, a comment and so on.
paths:
  /v3/content/text:
    parameters: []
    post:
      summary: Text API - Asynchronous
      responses:
        '200':
          $ref: '#/components/responses/200-async-text'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
      operationId: post-content-text
      parameters: []
      description: "Endpoint: https://api.alice.io/v3/content/text\n\nThe Asynchronous Text API enables you to send a text item and its context to the Alice T&S platform, which will analyze it, detect violations and return an array of one or more violations detected in the item in a callback. \n\nIf the ID of this text item already exists, then its details are updated.\n\nThe T&S platform analyzes the **text** and **thumbnail_url** fields.\n\n**NOTE** - **Text length is limited to 10,240 characters**. Longer texts should be split into segments (by punctuation or spacing) and sent in a separate request."
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  type: string
                  description: The text to analyze. Limited to 10,240 characters
                  maxLength: 10240
                content_id:
                  $ref: '#/components/schemas/content_id_async'
                category:
                  $ref: '#/components/schemas/category'
                callback_url:
                  $ref: '#/components/schemas/callback_url'
                callback_key_name:
                  $ref: '#/components/schemas/callback_key_name'
                thumbnail_url:
                  $ref: '#/components/schemas/thumbnail_url'
                date_created:
                  $ref: '#/components/schemas/date_created'
                views_count:
                  $ref: '#/components/schemas/views_count'
                comments_count:
                  $ref: '#/components/schemas/comments_count'
                user_id:
                  $ref: '#/components/schemas/user_id'
                contained_in:
                  $ref: '#/components/schemas/contained_in'
                webpage_url:
                  $ref: '#/components/schemas/webpage_url'
                custom_fields:
                  $ref: '#/components/schemas/custom_fields'
                response_custom_fields:
                  $ref: '#/components/schemas/response_custom_fields'
              required:
              - text
              - content_id
        description: Text, along with its context.
      callbacks:
        Analysis result:
          '{$request.body#/callback_url}':
            post:
              summary: callback with analysis result
              requestBody:
                description: Analysis result
                content:
                  application/json:
                    schema:
                      type: object
                      properties:
                        response_id:
                          $ref: '#/components/schemas/response_id'
                        entity_id:
                          $ref: '#/components/schemas/entity_id'
                        entity_type:
                          $ref: '#/components/schemas/entity_type'
                        violations:
                          type: array
                          items:
                            type: object
                            properties:
                              violation_type:
                                $ref: '#/components/schemas/violation_type_text'
                              risk_score:
                                $ref: '#/components/schemas/risk_score'
                              detection_type:
                                $ref: '#/components/schemas/detection_type'
                              analysis_description:
                                $ref: '#/components/schemas/analysis_description'
                        analyzed_violations:
                          type: array
                          description: violation types analyzed by Alice in this response
                          items:
                            $ref: '#/components/schemas/violation_type_text'
                        errors:
                          type: array
                          items:
                            $ref: '#/components/schemas/violation_error'
              responses:
                '200':
                  description: Callback successfully processed
      tags:
      - content
  /sync/v3/content/text:
    parameters: []
    post:
      summary: Text API - Synchronous
      operationId: post-sync-content-text
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  response_id:
                    $ref: '#/components/schemas/response_id_sync'
                  entity_id:
                    $ref: '#/components/schemas/entity_id'
                  entity_type:
                    $ref: '#/components/schemas/entity_type'
                  confidence:
                    $ref: '#/components/schemas/confidence'
                  language:
                    $ref: '#/components/schemas/language'
                  violations:
                    type: array
                    items:
                      type: object
                      properties:
                        violation_type:
                          $ref: '#/components/schemas/violation_type_text'
                        risk_score:
                          $ref: '#/components/schemas/risk_score'
                  errors:
                    type: array
                    items:
                      $ref: '#/components/schemas/violation_error'
                required:
                - response_id
                - entity_id
                - entity_type
                - violations
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                text:
                  $ref: '#/components/schemas/text'
                content_id:
                  $ref: '#/components/schemas/content_id'
                category:
                  $ref: '#/components/schemas/category'
                thumbnail_url:
                  $ref: '#/components/schemas/thumbnail_url'
                webpage_url:
                  $ref: '#/components/schemas/webpage_url'
                date_created:
                  $ref: '#/components/schemas/date_created'
                user_id:
                  $ref: '#/components/schemas/user_id'
                contained_in:
                  $ref: '#/components/schemas/contained_in'
                views_count:
                  $ref: '#/components/schemas/views_count'
                comments_count:
                  $ref: '#/components/schemas/comments_count'
                custom_fields:
                  $ref: '#/components/schemas/custom_fields'
                response_custom_fields:
                  $ref: '#/components/schemas/response_custom_fields'
              required:
              - text
              - content_id
            examples:
              Example:
                value:
                  text: text to analyze
                  content_id: entity123
                  category: chats
                  thumbnail_url: http://example.com
                  webpage_url: http://example.com
                  date_created: 1650886140
                  user_id: user123
                  contained_in:
                  - collection_id: channel123
                    collection_type: channel
                  views_count: 0
                  comments_count: 0
                  custom_fields:
                  - {}
        description: Text, along with its context.
      description: "Endpoint: https://api.alice.io/sync/v3/content/text\n\nThe Synchronous Text API enables you to send a text item and its context to the Alice T&S platform, which will analyze it, detect violations and return an array of one or more violations detected in the item synchronously. \n\nIf the ID of this text item already exists, then its details are updated.\n\nThe T&S platform analyzes the **text** field.\n\nNote - This API does not support **Promotes Terrorism** violation.\n\n**NOTE** - **Text length is limited to 1024 characters**. Longer texts should be split into segments (by punctuation or spacing) and sent in a separate request."
      tags:
      - content
      parameters: []
  /sync/v3/content/bulk/text:
    parameters: []
    post:
      summary: Bulk Text API - Synchronous
      operationId: post-sync-content-bulk-text
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  response_id:
                    $ref: '#/components/schemas/response_id_sync'
                  entity_type:
                    $ref: '#/components/schemas/entity_type'
                  items:
                    type: array
                    description: Array of results for each item sent in the request.
                    items:
                      type: object
                      properties:
                        entity_id:
                          $ref: '#/components/schemas/entity_id'
                        language:
                          $ref: '#/components/schemas/language'
                        violations:
                          type: array
                          items:
                            type: object
                            properties:
                              violation_type:
                                $ref: '#/components/schemas/violation_type_text'
                              risk_score:
                                $ref: '#/components/schemas/risk_score'
                              confidence:
                                $ref: '#/components/schemas/confidence'
                        errors:
                          type: array
                          items:
                            $ref: '#/components/schemas/violation_error'
                      required:
                      - entity_id
                      - violations
                  failed_item_indexes:
                    type: array
                    description: Array of indexes of items in the request that failed to be processed.
                    items:
                      type: number
                required:
                - response_id
                - entity_type
                - items
                - failed_item_indexes
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                category:
                  $ref: '#/components/schemas/category'
                contained_in:
                  $ref: '#/components/schemas/contained_in'
                items:
                  type: array
                  description: Array of text items to analyze. Minimum 1 item, Maximum 100 items.
                  items:
                    type: object
                    properties:
                      text:
                        $ref: '#/components/schemas/text'
                      content_id:
                        $ref: '#/components/schemas/content_id'
                      thumbnail_url:
                        $ref: '#/components/schemas/thumbnail_url'
                      webpage_url:
                        $ref: '#/components/schemas/webpage_url'
                      date_created:
                        $ref: '#/components/schemas/date_created'
                      user_id:
                        $ref: '#/components/schemas/user_id'
                      contained_in:
                        $ref: '#/components/schemas/contained_in'
                      views_count:
                        $ref: '#/components/schemas/views_count'
                      comments_count:
                        $ref: '#/components/schemas/comments_count'
                      custom_fields:
                        $ref: '#/components/schemas/custom_fields'
                      response_custom_fields:
                        $ref: '#/components/schemas/response_custom_fields'
                    required:
                    - text
                    - content_id
              required:
              - items
            examples:
              Example:
                value:
                  category: chats
                  contained_in:
                  - collection_id: channel123
                    collection_type: channel
                  items:
                  - text: text to analyze
                    content_id: entity123
                    thumbnail_url: http://example.com
                    webpage_url: http://example.com
                    date_created: 1650886140
                    user_id: user123
                    views_count: 0
                    comments_count: 0
                    custom_fields:
                    - {}
                  - text: another text to analyze
                    content_id: entity456
                    thumbnail_url: http://example.com
                    webpage_url: http://example.com
                    date_created: 1650886140
                    user_id: user123
                    views_count: 0
                    comments_count: 0
                    custom_fields:
                    - {}
        description: Bulk texts, along with contexts.
      description: "Endpoint: https://api.alice.io/sync/v3/content/bulk/text\n\nThe Synchronous Bulk Text API enables you to send a number of text items and their contexts to the Alice T&S platform in a single call, which will then analyze all of them, detect violations and return an array of one or more violations detected in each item synchronously. \n\n Since the number of items analyzed in each request is arbitrary and determined by the sender, there are no SLA guarantees on bulk item requests. \n\nThe T&S platform analyzes the **text** field of each item sent.\n\nNote - This API does not support **Promotes Terrorism** violation.\n\n**NOTE** - **Text length is limited to 1024 characters**. Longer texts should be split into segments (by punctuation or spacing) and sent as separate items.\n\nA bulk request is limited to 100 items maximum. A repeat of the same content_id in items in the same bulk request is **forbidden**, and will fail the duplicated item.\n\n**NOTE** This endpoint does not update items in the ActiveOS platform, and only returns the analysis on the request itself."
      tags:
      - content
      parameters: []
  /sync/v3/content/image:
    parameters: []
    post:
      summary: Image API - Synchronous
      operationId: post-sync-content-image
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  response_id:
                    $ref: '#/components/schemas/response_id_sync'
                  entity_id:
                    $ref: '#/components/schemas/entity_id'
                  entity_type:
                    $ref: '#/components/schemas/entity_type'
                  confidence:
                    $ref: '#/components/schemas/confidence'
                  language:
                    $ref: '#/components/schemas/language'
                  violations:
                    type: array
                    items:
                      type: object
                      properties:
                        violation_type:
                          $ref: '#/components/schemas/violation_type_image'
                        risk_score:
                          $ref: '#/components/schemas/risk_score'
                  errors:
                    type: array
                    items:
                      $ref: '#/components/schemas/violation_error'
                required:
                - response_id
                - entity_id
                - entity_type
                - violations
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content_id:
                  $ref: '#/components/schemas/content_id'
                category:
                  $ref: '#/components/schemas/category'
                media_url:
                  $ref: '#/components/schemas/media_url'
                webpage_url:
                  $ref: '#/components/schemas/webpage_url'
                title:
                  $ref: '#/components/schemas/title'
                description:
                  $ref: '#/components/schemas/description'
                date_created:
                  $ref: '#/components/schemas/date_created'
                views_count:
                  $ref: '#/components/schemas/views_count'
                comments_count:
                  $ref: '#/components/schemas/comments_count'
                user_id:
                  $ref: '#/components/schemas/user_id'
                contained_in:
                  $ref: '#/components/schemas/contained_in'
                custom_fields:
                  $ref: '#/components/schemas/custom_fields'
                response_custom_fields:
                  $ref: '#/components/schemas/response_custom_fields'
                raw_media:
                  $ref: '#/components/schemas/raw_media'
                mime_type:
                  $ref: '#/components/schemas/mime_type'
              required:
              - content_id
            examples:
              Example:
                value:
                  content_id: entity123
                  media_url: https://example.com/image.jpg
                  category: posts
                  title: Image title
                  description: Image description
                  webpage_url: https://example.com
                  date_created: 1650886140
                  user_id: user123
                  contained_in:
                  - collection_id: channel123
                    collection_type: channel
                  views_count: 0
                  comments_count: 0
                  custom_fields:
                  - {}
        description: Image, along with its context.
      description: 'Endpoint: https://api.alice.io/sync/v3/content/image


        The Synchronous Image API enables you to send an image item and its context to the Alice T&S platform, which will analyze it, detect violations and return an array of one or more violations detected in the item synchronously.


        If the ID of this image already exists, then its details are updated.


        The API supports the following file formats: **JPG, PNG, WEBP**.

        **Image file size is limited to 6k - 5MB**.


        The T&S platform analyzes the following fields:


        Analyzed image - **media_url** or **raw_media** fields.


        Analyzed texts - **title** and **description** fields.


        **NOTE** - **title field is limited to 1,024 characters and description field is limited to 10,240 characters**.'
      tags:
      - content
      parameters: []
  /v3/content/image:
    parameters: []
    post:
      summary: Image API - asynchronous
      operationId: post-content-image
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
      description: 'Endpoint: https://api.alice.io/v3/content/image


        The Image API enables you to send an image item and its context to the Alice T&S platform, which will analyze it, detect violations and return an array of one or more violations detected in the item. If the ID of this image already exists, then its details are updated.


        The API supports the following file formats: **JPG, PNG, WEBP**.

        **Image file size is limited to 6k - 5MB**.


        The T&S platform analyzes the following fields:


        Analyzed image - **media_url** or **raw_media** fields.


        Analyzed texts - **title** and **description** fields.


        **NOTE** - **title field is limited to 1,024 characters and description field is limited to 10,240 characters**.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content_id:
                  $ref: '#/components/schemas/content_id_async'
                category:
                  $ref: '#/components/schemas/category'
                media_url:
                  $ref: '#/components/schemas/media_url'
                callback_url:
                  $ref: '#/components/schemas/callback_url'
                callback_key_name:
                  $ref: '#/components/schemas/callback_key_name'
                webpage_url:
                  $ref: '#/components/schemas/webpage_url'
                title:
                  $ref: '#/components/schemas/title'
                description:
                  $ref: '#/components/schemas/description'
                date_created:
                  $ref: '#/components/schemas/date_created'
                views_count:
                  $ref: '#/components/schemas/views_count'
                comments_count:
                  $ref: '#/components/schemas/comments_count'
                user_id:
                  $ref: '#/components/schemas/user_id'
                contained_in:
                  $ref: '#/components/schemas/contained_in'
                custom_fields:
                  $ref: '#/components/schemas/custom_fields'
                response_custom_fields:
                  $ref: '#/components/schemas/response_custom_fields'
                raw_media:
                  $ref: '#/components/schemas/raw_media'
                mime_type:
                  $ref: '#/components/schemas/mime_type'
              required:
              - content_id
        description: ''
      callbacks:
        Analysis result:
          '{$request.body#/callback_url}':
            post:
              summary: Callback response
              requestBody:
                description: Analysis result
                content:
                  application/json:
                    schema:
                      type: object
                      properties:
                        response_id:
                          $ref: '#/components/schemas/response_id'
                        entity_id:
                          $ref: '#/components/schemas/entity_id'
                        entity_type:
                          $ref: '#/components/schemas/entity_type'
                        violations:
                          type: array
                          items:
                            type: object
                            properties:
                              violation_type:
                                $ref: '#/components/schemas/violation_type_image'
                              risk_score:
                                $ref: '#/components/schemas/risk_score'
                              detection_type:
                                $ref: '#/components/schemas/detection_type'
                              analysis_description:
                                $ref: '#/components/schemas/analysis_description'
                            required:
                            - violation_type
                            - risk_score
                        analyzed_violations:
                          type: array
                          description: violation types analyzed by Alice in this response
                          items:
                            $ref: '#/components/schemas/violation_types'
                        errors:
                          type: array
                          items:
                            $ref: '#/components/schemas/violation_error'
              responses:
                '200':
                  description: Callback successfully processed
      tags:
      - content
  /v3/content/video:
    parameters: []
    post:
      summary: Video API - asynchronous
      operationId: post-content-video
      responses:
        '200':
          $ref: '#/components/responses/200'
        '400':
          $ref: '#/components/responses/400'
        '401':
          $ref: '#/components/responses/401'
        '429':
          $ref: '#/components/responses/429'
      description: 'Endpoint: https://api.alice.io/v3/content/video


        The Video API enables you to send a video item and its context to the Alice T&S platform, which will analyze it, detect violations and return an array of one or more violations detected in the item. If the ID of this video already exists, then its details are updated.


        The API supports the following file formats: **mp4, mkv, avi**.


        Video length is limited to 30 min.


        Video file size is limited to 1GB.


        The T&S platform analyzes the following fields:


        Analyzed video - **media_url** or **raw_media** fields.


        Analyzed image - **thumbnail_url** field.


        Analyzed texts - **title** and **description** fields.


        **NOTE** - **title field is limited to 1,024 characters and description field is limited to 10,240 characters**.'
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                content_id:
                  $ref: '#/components/schemas/content_id_async'
                category:
                  $ref: '#/components/schemas/category'
                media_url:
                  $ref: '#/components/schemas/media_url'
                callback_url:
                  $ref: '#/components/schemas/callback_url'
                callback_key_name:
                  $ref: '#/components/schemas/callback_key_name'
                webpage_url:
                  $ref: '#/components/schemas/webpage_url'
                title:
                  $ref: '#/components/schemas/title'
                description:
                  $ref: '#/components/schemas/description'
                thumbnail_url:
                  $ref: '#/components/schemas/thumbnail_url'
                date_created:
                  $ref: '#/components/schemas/date_created'
                views_count:
                  $ref: '#/components/schemas/views_count'
                comments_count:
                  $ref: '#/components/schemas/comments_count'
                user_id:
                  $ref: '#/components/schemas/user_id'
                contained_in:
                  $ref: '#/components/schemas/contained_in'
                custom_fields:
                  $ref: '#/components/schemas/custom_fields'
                response_custom_fields:
                  $ref: '#/components/schemas/response_custom_fields'
                raw_media:
                  $ref: '#/components/schemas/raw_media'
                mime_type:
                  $ref: '#/components/schemas/mime_type'
              required:
              - content_id
        description: ''
      callbacks:
        Analysis result:
          '{$request.body#/callback_url}':
            post:
              summary: Callback response
              requestBody:
                description: Analysis result
                content:
                  application/json:
                    schema:
                      type: object
            

# --- truncated at 32 KB (54 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/alice/refs/heads/main/openapi/alice-content-api-openapi.yml