openapi: 3.2.0 info: title: Bonjoro API V2 Campaigns API description: Bonjoro API definitions version: 1.0.0 servers: - url: https://www.bonjoro.com/ tags: - name: Campaigns paths: /api/v2/campaigns: get: tags: - Campaigns summary: Get paginated campaigns operationId: getCampaigns parameters: - name: limit in: query required: false schema: type: number responses: '200': description: ok content: application/json: schema: $ref: '#/components/schemas/campaigns' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/unauthorized' security: - OAuth: [] /api/v2/campaigns/segmented: get: tags: - Campaigns summary: Get segmented campaigns operationId: getSegmentedCampaigns responses: '200': description: ok content: application/json: schema: $ref: '#/components/schemas/campaignsSegmented' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/unauthorized' security: - OAuth: [] /api/v2/campaigns/{campaign_id}: get: tags: - Campaigns summary: Get a campaign operationId: getCampaign parameters: - name: campaign_id in: path required: true schema: type: string format: uuid responses: '200': description: ok content: application/json: schema: properties: data: $ref: '#/components/schemas/campaign' type: object '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/unauthorized' '404': description: 404 Not Found content: application/json: schema: $ref: '#/components/schemas/notFound' security: - OAuth: [] put: tags: - Campaigns summary: Update a campaign operationId: putCampaign parameters: - name: campaign_id in: path required: true schema: type: string format: uuid requestBody: content: application/json: schema: $ref: '#/components/schemas/campaignUpdatePayload' responses: '200': description: ok content: application/json: schema: properties: message: type: string example: Updated data: $ref: '#/components/schemas/campaignWithUsers' type: object '400': description: 400 Bad Request content: application/json: schema: $ref: '#/components/schemas/badRequest' '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/unauthorized' '404': description: 404 Not Found content: application/json: schema: $ref: '#/components/schemas/notFound' security: - OAuth: [] delete: tags: - Campaigns summary: Delete a campaign operationId: deleteCampaign parameters: - name: campaign_id in: path required: true schema: type: string format: uuid responses: '200': description: ok content: application/json: schema: properties: message: type: string example: Deleted data: $ref: '#/components/schemas/campaignWithUsers' type: object '401': description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/unauthorized' '404': description: 404 Not Found content: application/json: schema: $ref: '#/components/schemas/notFound' security: - OAuth: [] components: schemas: campaignWithUsers: type: object allOf: - properties: users: type: array items: allOf: - $ref: '#/components/schemas/user' - $ref: '#/components/schemas/campaign' user: properties: id: type: string format: uuid example: bbf3195e-21a3-4e6a-9698-9b8c09ec0b5b bio: type: string example: Example bio first_name: type: string example: John image: type: string format: uri example: https://example-path-to-image.jpg last_name: type: string example: Jones name: type: string example: John Jones self_url: type: string format: uri example: https://example-path-to-self-url team_url: type: string format: uri example: https://example-path-to-team-url type: object campaignsSegmented: properties: data: properties: accessible: type: array items: allOf: - $ref: '#/components/schemas/campaignWithUsers' inaccessible: type: array items: allOf: - $ref: '#/components/schemas/campaignWithUsers' templates: type: array items: {} type: object type: object badRequest: properties: error: properties: message: type: string example: Error message status_code: type: integer example: 400 type: object type: object pagination: properties: current_page: type: integer example: 1 first_page_url: type: string last_page_url: type: string path: type: string from: type: integer example: 1 last_page: type: integer example: 2 next_page_url: type: string per_page: type: integer example: 15 prev_page_url: type: integer type: object campaigns: allOf: - properties: data: type: array items: allOf: - $ref: '#/components/schemas/campaignWithUsers' type: object - $ref: '#/components/schemas/pagination' notFound: properties: error: properties: message: type: string example: Not Found status_code: type: integer example: 404 type: object type: object campaign: properties: id: type: integer example: 5 uuid: type: string format: uuid slug: type: string example: task-list name: type: string example: Task List goal: type: - string - 'null' type: type: string example: Default is_default: type: boolean example: true is_private: type: boolean example: false archived_at: type: - string - 'null' creator: $ref: '#/components/schemas/user' type: object unauthorized: properties: message: type: string example: Unauthorized. type: object campaignUpdatePayload: required: - name properties: type: type: - string - 'null' enum: - Default - Onboarding - Activation - Retention - Team updates - Prospecting - Lead Conversion - Thanking - Upselling - Seasonal - Other name: type: string example: My Campaign goal: type: - string - 'null' example: Reach out to all is_private: type: - boolean - 'null' example: false users: type: array items: type: string format: uuid type: object