Mixpanel Service Accounts API

Manage service accounts for API access

OpenAPI Specification

mixpanel-service-accounts-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Mixpanel Annotations Service Accounts API
  description: API for creating, retrieving, updating, and deleting annotations that label specific points in time on Mixpanel charts with descriptions, useful for marking product launches, campaigns, or data anomalies.
  version: '1.0'
  contact:
    name: Mixpanel Support
    email: support@mixpanel.com
    url: https://mixpanel.com/get-support
  termsOfService: https://mixpanel.com/legal/terms-of-use
servers:
- url: https://mixpanel.com/api/app
  description: Mixpanel US Data Residency
- url: https://eu.mixpanel.com/api/app
  description: Mixpanel EU Data Residency
security:
- basicAuth: []
tags:
- name: Service Accounts
  description: Manage service accounts for API access
paths:
  /organizations/{organizationId}/service-accounts:
    get:
      operationId: listServiceAccounts
      summary: Mixpanel List service accounts
      description: Retrieve all service accounts within an organization.
      tags:
      - Service Accounts
      parameters:
      - $ref: '#/components/parameters/organizationId'
      responses:
        '200':
          description: List of service accounts
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      $ref: '#/components/schemas/ServiceAccount'
        '401':
          description: Unauthorized
        '403':
          description: Forbidden - insufficient organization permissions
    post:
      operationId: createServiceAccount
      summary: Mixpanel Create a service account
      description: Create a new service account within the organization. Returns the service account credentials including the secret which is only shown once.
      tags:
      - Service Accounts
      parameters:
      - $ref: '#/components/parameters/organizationId'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateServiceAccountRequest'
      responses:
        '200':
          description: Service account created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceAccountWithSecret'
        '400':
          description: Invalid request
        '401':
          description: Unauthorized
        '403':
          description: Forbidden
  /organizations/{organizationId}/service-accounts/{serviceAccountId}:
    get:
      operationId: getServiceAccount
      summary: Mixpanel Get service account
      description: Retrieve details of a specific service account.
      tags:
      - Service Accounts
      parameters:
      - $ref: '#/components/parameters/organizationId'
      - $ref: '#/components/parameters/serviceAccountId'
      responses:
        '200':
          description: Service account details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceAccount'
        '401':
          description: Unauthorized
        '404':
          description: Service account not found
    delete:
      operationId: deleteServiceAccount
      summary: Mixpanel Delete service account
      description: Delete a service account. This revokes all API access for the account immediately.
      tags:
      - Service Accounts
      parameters:
      - $ref: '#/components/parameters/organizationId'
      - $ref: '#/components/parameters/serviceAccountId'
      responses:
        '200':
          description: Service account deleted
        '401':
          description: Unauthorized
        '404':
          description: Service account not found
components:
  parameters:
    organizationId:
      name: organizationId
      in: path
      required: true
      schema:
        type: integer
      description: The Mixpanel organization ID
    serviceAccountId:
      name: serviceAccountId
      in: path
      required: true
      schema:
        type: integer
      description: The service account ID
  schemas:
    ServiceAccount:
      type: object
      properties:
        id:
          type: integer
          description: Service account unique identifier
        name:
          type: string
          description: Service account display name
        username:
          type: string
          description: Service account username for basic auth
        organizationId:
          type: integer
          description: Parent organization ID
        createdAt:
          type: string
          format: date-time
          description: When the service account was created
    CreateServiceAccountRequest:
      type: object
      required:
      - name
      properties:
        name:
          type: string
          description: Display name for the service account
    ServiceAccountWithSecret:
      allOf:
      - $ref: '#/components/schemas/ServiceAccount'
      - type: object
        properties:
          secret:
            type: string
            description: Service account secret (only returned once at creation). Store this securely.
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
      description: Service account credentials for API authentication.
externalDocs:
  description: Mixpanel Annotations API Documentation
  url: https://developer.mixpanel.com/reference/create-annotation