Gojiberry AI User API

The User API from Gojiberry AI — 2 operation(s) for user.

OpenAPI Specification

gojiberry-ai-user-api-openapi.yml Raw ↑
openapi: 3.0.0
info:
  title: Gojiberry AI - External AppExternal User API
  description: "\n# Gojiberry AI External API\n\nThis API allows you to programmatically access your Gojiberry AI data and integrate it with your applications.\n\n## Authentication\n\nAll API requests require authentication using a Bearer token. To get your API key:\n\n1. **Log in to your Gojiberry AI account** at [https://app.gojiberry.ai](https://app.gojiberry.ai)\n2. **Navigate to Settings** → **API** section\n3. **Click \"Create API Key\"** to generate a new token\n4. **Copy the API key** when it's displayed (you won't be able to see it again)\n5. **Use the token** in your requests by adding the header: `Authorization: Bearer YOUR_API_KEY`\n\n## Impersonation (organization owners)\n\nIf your API key belongs to the **owner of an organization**, you can perform any API call on behalf of another member of your organization by adding the `x-impersonate-user-id` header with the member's user ID:\n\n```bash\n# Get the contacts of the organization member with user ID 123\ncurl -H \"Authorization: Bearer YOUR_API_KEY\" \\\n     -H \"x-impersonate-user-id: 123\" \\\n     https://ext.gojiberry.ai/v1/contact\n```\n\nWhen impersonating, the request behaves exactly as if it was made by that member: you read and write their data (contacts, campaigns, lists, unibox, etc.).\n\nRules:\n- Your API key must belong to the **organization owner**; other members cannot impersonate.\n- The impersonated user must belong to the **same organization** as the API key user.\n- Requests that don't meet these rules are rejected with a `401 Unauthorized`.\n\nTip: use `GET /v1/organization/members` to list the members of your organization and their user IDs, and `GET /v1/user/me` to verify which user the current request acts as.\n\n## Rate Limits\n\n- **100 requests per minute** per API key\n\n## Base URL\n- **Production**: `https://ext.gojiberry.ai`\n\n## Endpoints\n\n### Contacts\n- `GET /v1/contact` - Get all contacts with filtering and pagination\n- `GET /v1/contact/{id}` - Get a specific contact\n- `GET /v1/contact/health` - Health check endpoint\n\n## Example Usage\n\n```bash\n# Get all contacts\ncurl -H \"Authorization: Bearer YOUR_API_KEY\" \\\n     https://ext.gojiberry.ai/v1/contact\n\n# Get contacts with filtering\ncurl -H \"Authorization: Bearer YOUR_API_KEY\" \\\n     \"https://ext.gojiberry.ai/v1/contact?search=john&agent=1&dateFrom=2024-01-01\"\n\n# Get a specific contact\ncurl -H \"Authorization: Bearer YOUR_API_KEY\" \\\n     https://ext.gojiberry.ai/v1/contact/123\n```\n\n## Webhooks\n\nGojiberry allows you to receive real-time notifications when new contacts are created or updated by configuring a webhook URL.\n\n### How to Configure Webhooks\n\n1. **Log in to your Gojiberry AI account** at [https://app.gojiberry.ai](https://app.gojiberry.ai)\n2. **Navigate to the Integrations page** at [https://app.gojiberry.ai/integrations](https://app.gojiberry.ai/integrations)\n3. **Add a Webhook integration** by clicking the Webhook option\n4. **Enter your webhook URL** where you want to receive notifications\n5. **Save the configuration**\n\nOnce configured, Gojiberry will send POST requests to your webhook URL whenever:\n- A new contact is created\n- A contact is updated\n- Other relevant events occur in your account\n\nThe webhook payload will include the full contact data in JSON format. Each webhook request includes a custom header `x-gojiberry-user-id` containing your user ID for verification purposes.\n\n## Support\n\nFor API support, please contact us at [hello@gojiberry.ai](mailto:hello@gojiberry.ai)\n      "
  version: '1.0'
  contact: {}
servers: []
tags:
- name: User
paths:
  /v1/user/me:
    get:
      description: Retrieve the profile of the authenticated user. When impersonating with the x-impersonate-user-id header, the impersonated user is returned.
      operationId: UserExternalController_getMe
      parameters:
      - name: x-impersonate-user-id
        in: header
        description: ID of an organization member to act on behalf of. The API key user must be the owner of the organization and the target user must belong to the same organization.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: User information
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: number
                    description: User ID
                  email:
                    type: string
                    description: Email address
                  firstName:
                    type: string
                    nullable: true
                    description: First name
                  lastName:
                    type: string
                    nullable: true
                    description: Last name
                  organizationId:
                    type: number
                    nullable: true
                    description: ID of the organization the user belongs to
                  organizationRole:
                    type: string
                    enum:
                    - member
                    - admin
                    description: Role of the user in the organization
                  isActive:
                    type: boolean
                    description: Whether the account is active
                  language:
                    type: string
                    nullable: true
                    description: Preferred language (e.g. en-US)
                  country:
                    type: string
                    nullable: true
                    description: Country code (ISO 3166-1 alpha-2)
                  timezone:
                    type: string
                    nullable: true
                    description: Timezone (e.g. Europe/Paris)
                  createdAt:
                    type: string
                    format: date-time
                    description: Account creation date
      security:
      - bearer: []
      summary: Get the authenticated user
      tags:
      - User
  /v1/user/me/permissions:
    get:
      description: Retrieve the organization permissions of the authenticated user. When impersonating with the x-impersonate-user-id header, the impersonated user permissions are returned.
      operationId: UserExternalController_getMyPermissions
      parameters:
      - name: x-impersonate-user-id
        in: header
        description: ID of an organization member to act on behalf of. The API key user must be the owner of the organization and the target user must belong to the same organization.
        required: false
        schema:
          type: string
      responses:
        '200':
          description: List of permission keys granted to the user in their organization
          content:
            application/json:
              schema:
                type: array
                items:
                  type: string
                  enum:
                  - organization.delete
                  - organization.settings.update
                  - organization.ownership.transfer
                  - organization.members.remove
                  - organization.members.change_role
                  - organization.members.impersonate
                  - organization.owner.impersonate
                  - organization.invitations.create
                  - organization.invitations.revoke
                  - organization.billing.manage
                  - organization.team_analytics.view
                example:
                - organization.settings.update
                - organization.members.remove
      security:
      - bearer: []
      summary: Get the permissions of the authenticated user
      tags:
      - User
components:
  securitySchemes:
    API-Key:
      scheme: bearer
      bearerFormat: JWT
      type: http
      name: JWT
      description: Enter API Key
      in: header