> ## Documentation Index
> Fetch the complete documentation index at: https://swapnice.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# List intents

> Outcome, habit, affiliate, sentiment, and activation scores.

Outcome, habit, affiliate, sentiment, and activation scores.

Optional `category` query filters the five intent families.


## OpenAPI

````yaml openapi.yaml GET /v1/profiles/{customer_id}/intents
openapi: 3.0.3
info:
  title: Swapnice Partner API
  version: 0.1.0
  description: >
    Swapnice's partner API lets trusted partner applications connect customer
    accounts,

    collect explicit consent, ingest governed events and claims, and
    synchronously read

    consent-filtered profile intelligence with provenance.


    The API is designed for a Cloudflare Workers gateway backed by Durable
    Objects for

    short-lived sessions, per-customer ordering, consent coordination, and
    idempotency,

    plus D1 for longer-lived partner app configuration, consent archives, token
    metadata,

    customer records, and audit history.


    Public schemas use descriptive field names. Compact Firebase-era storage
    keys such as

    `c0`, `p0`, or `upiv` are internal implementation details and must not be
    exposed.
  contact:
    name: Swapnice API Support
    email: api@swapnice.com
  license:
    name: Proprietary
    url: https://swapnice.com/legal/api-terms
servers:
  - url: https://api.swapnice.com
    description: Production API
  - url: https://api.sandbox.swapnice.com
    description: Sandbox API
security:
  - OAuth2: []
tags:
  - name: OAuth
    description: OAuth 2.1 authorization, token, introspection, revocation, and discovery.
  - name: Apps
    description: Partner OAuth application configuration and webhook endpoints.
  - name: Connection Sessions
    description: Short-lived account-linking sessions coordinated by Durable Objects.
  - name: Consent
    description: Consent grants, receipts, effective consent state, and revocation.
  - name: Customers
    description: Partner-scoped customer records and metadata.
  - name: Ontologies
    description: Ontology contracts and filter-field metadata for entries and events.
  - name: Entries
    description: Ontology-backed collectible entries using readable external fields.
  - name: Events
    description: Non-blocking ordered event and claim ingestion.
  - name: Profiles
    description: Consent-aware synchronous reads for claims, intents, and profile facts.
  - name: Webhooks
    description: Partner webhook endpoint registration and delivery status.
paths:
  /v1/profiles/{customer_id}/intents:
    get:
      tags:
        - Profiles
      summary: List resolved intents
      operationId: listIntents
      parameters:
        - $ref: '#/components/parameters/CustomerId'
        - $ref: '#/components/parameters/ConsentPurposeQuery'
        - name: category
          in: query
          required: false
          schema:
            $ref: '#/components/schemas/IntentCategory'
        - $ref: '#/components/parameters/PageCursor'
        - $ref: '#/components/parameters/PageLimit'
      responses:
        '200':
          description: Paginated resolved intents.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/PaginatedResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/ResolvedIntent'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - OAuth2:
            - intents:read
components:
  parameters:
    CustomerId:
      name: customer_id
      in: path
      required: true
      schema:
        type: string
      example: cus_partner_123
    ConsentPurposeQuery:
      name: consent_purpose
      in: query
      required: false
      schema:
        $ref: '#/components/schemas/ConsentPurpose'
    PageCursor:
      name: cursor
      in: query
      required: false
      schema:
        type: string
    PageLimit:
      name: limit
      in: query
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
  schemas:
    IntentCategory:
      type: string
      enum:
        - outcome
        - sentiment
        - affiliate
        - habit
        - activation
    PaginatedResponse:
      type: object
      required:
        - data
        - pagination
      properties:
        data:
          type: array
          items:
            type: object
            additionalProperties: true
        pagination:
          $ref: '#/components/schemas/Pagination'
    ResolvedIntent:
      type: object
      required:
        - id
        - category
        - object
        - confidence
        - consent_purpose
        - evidence
      properties:
        id:
          type: string
        category:
          $ref: '#/components/schemas/IntentCategory'
        object:
          type: string
        confidence:
          type: number
          minimum: 0
          maximum: 1
        consent_purpose:
          $ref: '#/components/schemas/ConsentPurpose'
        evidence:
          type: array
          items:
            $ref: '#/components/schemas/Claim'
    ConsentPurpose:
      type: string
      enum:
        - account_linking
        - personalization
        - analytics
        - support
        - event_enrichment
        - profile_resolution
        - measurement
    Pagination:
      type: object
      required:
        - has_more
      properties:
        next_cursor:
          type: string
          nullable: true
        has_more:
          type: boolean
    Claim:
      type: object
      required:
        - id
        - customer_id
        - attribute
        - value
        - source
        - observed_at
        - consent_purpose
        - confidence
        - provenance
      properties:
        id:
          type: string
        customer_id:
          type: string
        attribute:
          type: string
        value:
          description: Claim value. Type depends on the attribute.
          oneOf:
            - type: string
            - type: number
            - type: boolean
            - type: object
              additionalProperties: true
            - type: array
              items:
                type: string
        source:
          type: string
        observed_at:
          type: string
          format: date-time
        context:
          type: string
        consent_purpose:
          $ref: '#/components/schemas/ConsentPurpose'
        confidence:
          type: number
          minimum: 0
          maximum: 1
        provenance:
          $ref: '#/components/schemas/Provenance'
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
            - request_id
          properties:
            code:
              type: string
              example: consent_denied
            message:
              type: string
            request_id:
              type: string
            details:
              type: array
              items:
                $ref: '#/components/schemas/ErrorDetail'
    Provenance:
      type: object
      required:
        - source_partner
        - collected_at
      properties:
        source_partner:
          type: string
        source_system:
          type: string
        collected_at:
          type: string
          format: date-time
        evidence_url:
          type: string
          format: uri
    ErrorDetail:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
        message:
          type: string
        field:
          type: string
  responses:
    Forbidden:
      description: Scope or consent boundary denied.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    NotFound:
      description: Resource not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    OAuth2:
      type: oauth2
      description: >-
        OAuth 2.1 authorization code with PKCE. Implicit and password flows are
        unsupported.
      flows:
        authorizationCode:
          authorizationUrl: https://api.swapnice.com/oauth/authorize
          tokenUrl: https://api.swapnice.com/oauth/token
          refreshUrl: https://api.swapnice.com/oauth/token
          scopes:
            offline_access: Issue rotating refresh tokens when allowed.
            apps:read: Read partner app configuration.
            apps:write: Manage partner app configuration.
            connections:read: Read connection sessions.
            connections:write: Create or cancel connection sessions.
            consent:read: Read consent receipts and effective consent.
            consent:write: Create and revoke consent.
            customers:read: Read partner customers.
            customers:write: Create or update partner customers.
            ontologies:read: Read ontologies and field maps.
            ontologies:write: Rebuild ontology filter metadata.
            entries:read: Read ontology-backed entries.
            entries:write: Create or update ontology-backed entries.
            events:read: Read event status.
            events:write: Ingest events and claims.
            profile:read: Read resolved profile facts.
            profiles:read: Read profile resources.
            claims:read: Read claims.
            intents:read: Read intents.
            webhooks:read: Read webhook endpoints.
            webhooks:write: Manage webhook endpoints.
            workflows:read: Read async workflow status.
            tokens:introspect: Introspect tokens.
            tokens:revoke: Revoke tokens.

````