Cobot Event API

Spaces can run events for their members or the public. Events are created and later published by admins, at which point members are able to see and attend them. Admins can also create messages for events, which are sent to attendees based on triggers such as someone having just attended an event.

OpenAPI Specification

cobot-event-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cobot Event API
  termsOfService: https://www.cobot.me/terms
  x-logo:
    url: /api2_logo.webp
    backgroundColor: '#FFFFFF'
    altText: Cobot logo
  description: "This is the 2.0 version of the Cobot API. You can find version 1.0\nas well as various tutorials under [/api-docs](/api-docs).\n\n## JSON API\n\nThis API follows the [JSON API](http://jsonapi.org) standard. This means:\n\n* requests and responses are sent in JSON\n* all requests MUST send a `Accept: application/vnd.api+json` header\n* non-GET requests MUST send a `Content-Type: application/vnd.api+json` header\n* all responses send a `Content-Type: application/vnd.api+json` header\n* all JSON formats are standardized (requests, responses, errors)\n\n## Cross-Origin Resource Sharing (CORS)\n\nAll endpoints send [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS)\nheaders so that the API can be used from within browsers.\n\n## Rate Limiting\n\nIn general, the rate limit for an endpoint is 60 requests per minute per user.\nIf applicable, alternative limits are given in the documentation for\nparticular endpoints.\n\nIf you've exceeded the limit, Cobot will return a 429 status code and a JSON\nerror message. The response will also contain a *Retry-After* header, this\ndenotes the number of seconds to wait before your client may retry.\n\n## Times and Dates\n\nTimes and Dates must be in ISO 8601 formats. e.g. date: `2021-01-07`, datetime: `2021-01-07T16:25:51Z`,  time: `16:25:51`.\nMillisecond are ommited, so `16:25:51.811` will become `16:25:51`.\nTime zone offsets must be provided by the client, e.g. `16:25:51+02:00` or '16:25:51Z' for UTC.\n\nTimes are always returned in UTC.\n## Sparse Fieldsets\n\nThis API supports [sparse fieldsets](https://jsonapi.org/format/#fetching-sparse-fieldsets),\nso clients can request which attributes they are interested in.\n\nExample:\n```\nGET https://api.cobot.me/user?fields[users]=email\n```\nThis will only return the user's email.\n\n## Query params\n\nWhen passing query params, arrays of data are expected to be sent as a string of comma separated values.\n\n## Pagination\n\nAll collections are paginated. Pagination follows [JSON-API standards](https://jsonapi.org/format/#fetching-pagination).\n\nExample:\n```json\n{\n  \"meta\": {\n    \"totalPages\": 2,\n    \"currentPage\": 1\n  },\n  \"data\": [{\n    \"id\": \"1\",\n    \"type\": \"users\",\n  }],\n  \"links\": {\n    \"self\": \"/users?page[size]=100&page[number]=1\",\n    \"first\": \"/users?page[size]=100&page[number]=1\",\n    \"prev\": null,\n    \"next\": \"/users?page[size]=100&page[number]=2\",\n    \"last\": \"/users?page[size]=100&page[number]=1\"\n  }\n}\n```\n\nDefault page size is 72 and can be changed by passing a `page[size]` parameter. Maximum page size is 200.\n\n## Errors\n\nWhen a client sends invalid data in a request, Cobot returns a\n422 status code and a JSON-API error response.\n\nExample:\n```json\n{\n  \"errors\": [\n    {\n      \"source\": {\n        \"pointer\": \"/data/attributes/name\"\n      },\n      \"detail\": \"can't be blank\"\n    },\n    {\n      \"source\": {\n        \"pointer\": \"/data/attributes/password\"\n      },\n      \"detail\": \"is too short\"\n    }\n  ]\n}\n```\n"
  version: '2.0'
  contact:
    name: Cobot Support
    url: https://dev.cobot.me/
    email: support@cobot.me
servers:
- url: https://api.cobot.me
security:
- OAuth2: []
tags:
- name: Event
  description: 'Spaces can run events for their members or the public.

    Events are created and later published by admins, at which point members are able to see and attend them.

    Admins can also create messages for events, which are sent to attendees based on triggers such as someone having

    just attended an event.

    '
paths:
  /events:
    post:
      summary: Create event
      description: 'Create events as an admin. To become visible to members, events

        have to be published after being created.

        Events can be associated with resources, in which cases the

        resources will be booked for the duration of the event.

        **Access**: The current user must be an admin of the space.

        '
      operationId: create-admin-event
      security:
      - OAuth2:
        - write_events
        - write_bookings
      tags:
      - Event
      responses:
        '201':
          description: New event
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/event'
              examples:
                default:
                  value:
                    data:
                      id: b8f21a71ac8df98d29de357180d27358
                      type: events
                      attributes:
                        from: '2018-01-01T12:00:00Z'
                        to: '2018-01-01T14:00:00Z'
                        title: launch party
                        price:
                          net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - rate: '20.0'
                            name: Tax
                        visitorPrice: null
                        expectedRevenue:
                        - net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - rate: '20.0'
                            name: Tax
                        audience: membersOnly
                        color: '#FF0000'
                        accountingCode: EVT
                        visitorAccountingCode: null
                        costCenter:
                          name: Events Revenue
                          number: E17
                        revenueAccount:
                          name: Events Revenue
                          number: '4000'
                        visitorCostCenter: null
                        visitorRevenueAccount: null
                        image:
                          icon:
                            url: https://cdn.com/event/image/a4a99a71ac8df98d29de357180d273d3/icon_photo.png
                            width: 120
                            height: 120
                          default:
                            url: https://cdn.com/event/image/a4a99a71ac8df98d29de357180d273d3/default_photo.png
                            width: 800
                            height: 600
                        description: We are relaunching our coworking space!
                        location: Lobby
                        tags:
                        - party
                        videoUrl: null
                        capacity: 85
                        publishedState: draft
                        publicPage: false
                        publicUrl: null
                        canDepublish: false
                      relationships:
                        attendances:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/attendances
                        bookings:
                          data:
                          - id: 419cabc7547473ea91762671f4641701
                            type: bookings
                        messages:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/messages
                        publication:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/publication
                        resources:
                          data:
                          - id: a4a99a71ac8df98d29de357180d273d3
                            type: resources
                        space:
                          data:
                            id: f9a99a71ac8df98d29de357180d273d3
                            type: spaces
      requestBody:
        description: Event to be created for a space.
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/create-event'
            examples:
              default:
                value:
                  data:
                    type: events
                    attributes:
                      from: '2018-01-01T12:00:00Z'
                      to: '2018-01-01T14:00:00Z'
                      title: launch party
                      price:
                        net: '10.0'
                        currency: EUR
                      accountingCode: EVT
                      costCenter:
                        name: Events
                        number: 2018-1
                      visitorCostCenter:
                        name: Visitor Events
                        number: 2018-1
                      revenueAccount:
                        name: Events
                        number: '4000'
                      visitorRevenueAccount:
                        name: Visitor Events
                        number: '4001'
                      audience: membersOnly
                      image:
                        data: data:image/png;base64,...
                      description: We are relaunching our coworking space!
                      location: Lobby
                      tags:
                      - party
                      videoUrl: null
                      capacity: 85
                    relationships:
                      space:
                        data:
                          id: 99da6cb66b5e6b39007690854fd66df9
                          type: spaces
                      resources:
                        data:
                        - id: 89da3cb66b5e6b39007690854kd66da4
                          type: resources
                          meta:
                            units: 3
  /events/{id}:
    get:
      summary: Single event
      description: 'Show a single event.


        **Access**: The current user must either be an admin or a member of a space or the space''s network unless the event is public.

        Including `attendances` or `attendances.attendee` requires the current user to be an admin or member of the space or the space''s network.

        '
      operationId: get-event
      parameters:
      - name: id
        in: path
        required: true
        description: The id of the event.
        schema:
          type: string
      - name: include
        in: query
        required: false
        description: 'List of related resources to include in response as comma separated string.


          Including `attendances.attendee` will also return `attendances`.

          A maximum of 5 attendances per event is returned. If the current user is attending,

          their attendance will be included in the 5. The full count is returned in the meta section.


          Including `attendances` requires the `read_event_attendances` scope.

          Including `attendances.attendee` requires the `read_event_attendances`, `read_memberships` and `read_contacts` scopes.

          '
        schema:
          type: array
          items:
            type: string
            enum:
            - attendances
            - attendances.attendee
      security:
      - OAuth2:
        - read_events
      tags:
      - Event
      responses:
        '200':
          description: A single event
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/event'
              examples:
                default:
                  value:
                    data:
                      id: b8f21a71ac8df98d29de357180d27358
                      type: events
                      attributes:
                        from: '2018-01-01T12:00:00Z'
                        to: '2018-01-01T14:00:00Z'
                        title: launch party
                        price:
                          net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - rate: '20.0'
                            name: Tax
                        visitorPrice: null
                        expectedRevenue:
                        - net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - rate: '20.0'
                            name: Tax
                        audience: membersOnly
                        color: '#FF0000'
                        accountingCode: EVT
                        visitorAccountingCode: null
                        costCenter:
                          name: Events Revenue
                          number: E17
                        revenueAccount:
                          name: Events Revenue
                          number: '4000'
                        visitorCostCenter: null
                        visitorRevenueAccount: null
                        image:
                          icon:
                            url: https://cdn.com/event/image/a4a99a71ac8df98d29de357180d273d3/icon_photo.png
                            width: 120
                            height: 120
                          default:
                            url: https://cdn.com/event/image/a4a99a71ac8df98d29de357180d273d3/default_photo.png
                            width: 800
                            height: 600
                        description: We are relaunching our coworking space!
                        location: Lobby
                        tags:
                        - party
                        videoUrl: null
                        capacity: 85
                        publishedState: draft
                        publicPage: false
                        publicUrl: null
                        canDepublish: false
                      relationships:
                        attendances:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/attendances
                        bookings:
                          data:
                          - id: 419cabc7547473ea91762671f4641701
                            type: bookings
                        messages:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/messages
                        publication:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/publication
                        resources:
                          data:
                          - id: a4a99a71ac8df98d29de357180d273d3
                            type: resources
                        space:
                          data:
                            id: f9a99a71ac8df98d29de357180d273d3
                            type: spaces
    patch:
      summary: Update event
      description: 'Update the details of an event. Note that the `publishedStatus` attribute can only be

        changed via the publish/depublish endpoints.


        **Access**: The current user must be an admin of the space the event belongs to.

        '
      operationId: update-event
      parameters:
      - name: id
        in: path
        required: true
        description: The id of the event.
        schema:
          type: string
      security:
      - OAuth2:
        - write_events
      tags:
      - Event
      responses:
        '200':
          description: The updated event.
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/event'
              examples:
                default:
                  value:
                    data:
                      id: b8f21a71ac8df98d29de357180d27358
                      type: events
                      attributes:
                        from: '2018-01-01T12:00:00Z'
                        to: '2018-01-01T14:00:00Z'
                        title: launch party
                        price:
                          net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - rate: '20.0'
                            name: Tax
                        visitorPrice: null
                        expectedRevenue:
                        - net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - rate: '20.0'
                            name: Tax
                        audience: membersOnly
                        color: '#FF0000'
                        accountingCode: EVT
                        visitorAccountingCode: null
                        costCenter:
                          name: Events Revenue
                          number: E17
                        revenueAccount:
                          name: Events Revenue
                          number: '4000'
                        visitorCostCenter: null
                        visitorRevenueAccount: null
                        image:
                          icon:
                            url: https://cdn.com/event/image/a4a99a71ac8df98d29de357180d273d3/icon_photo.png
                            width: 120
                            height: 120
                          default:
                            url: https://cdn.com/event/image/a4a99a71ac8df98d29de357180d273d3/default_photo.png
                            width: 800
                            height: 600
                        description: We are relaunching our coworking space!
                        location: Lobby
                        tags:
                        - party
                        videoUrl: null
                        capacity: 85
                        publishedState: draft
                        publicPage: false
                        publicUrl: null
                        canDepublish: false
                      relationships:
                        attendances:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/attendances
                        bookings:
                          data:
                          - id: 419cabc7547473ea91762671f4641701
                            type: bookings
                        messages:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/messages
                        publication:
                          links:
                            related: https://api.cobot.me/events/b8f21a71ac8df98d29de357180d27358/publication
                        resources:
                          data:
                          - id: a4a99a71ac8df98d29de357180d273d3
                            type: resources
                        space:
                          data:
                            id: f9a99a71ac8df98d29de357180d273d3
                            type: spaces
      requestBody:
        description: Event to be updated.
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/update-event'
            examples:
              default:
                value:
                  data:
                    id: b8f21a71ac8df98d29de357180d27358
                    type: events
                    attributes:
                      from: '2018-01-01T12:00:00Z'
                      to: '2018-01-01T14:00:00Z'
                      title: launch party
                      price:
                        net: '10.0'
                        currency: EUR
                      audience: membersOnly
                      accountingCode: EVT
                      costCenter:
                        name: Events
                        number: 2018-1
                      visitorCostCenter:
                        name: Visitor Events
                        number: 2018-1
                      revenueAccount:
                        name: Events
                        number: '4000'
                      visitorRevenueAccount:
                        name: Visitor Events
                        number: '4001'
                      image:
                        data: data:image/png;base64,...
                      description: We are relaunching our coworking space!
                      location: Lobby
                      tags:
                      - party
                      videoUrl: null
                      capacity: 85
                    relationships:
                      resources:
                        data:
                        - id: 89da3cb66b5e6b39007690854kd66da4
                          type: resources
                          meta:
                            units: all
    delete:
      summary: Delete event
      description: 'Deleting an event will notify all attendees and refund their tickets if applicable.

        **Access**: The current user must be an admin of the space the event belongs to.

        '
      operationId: delete-event
      parameters:
      - name: id
        in: path
        required: true
        description: The id of the event.
        schema:
          type: string
      security:
      - OAuth2:
        - write_events
      tags:
      - Event
      responses:
        '204':
          description: Empty response
  /event_attendances:
    post:
      summary: Attend event
      description: 'Attend an event as member. Automatically creates a `Charge`

        on the membership if the event has a price.


        **Access**: The current user must be a member of the space.

        '
      operationId: attend-event
      security:
      - OAuth2:
        - write_event_attendances
      tags:
      - Event
      requestBody:
        description: The membership that wants to attend and the event to attend.
        required: true
        content:
          application/vnd.api+json:
            schema:
              $ref: '#/components/schemas/create-event-attendance'
            examples:
              default:
                value:
                  data:
                    type: eventAttendances
                    attributes:
                      visibility: public
                    relationships:
                      event:
                        data:
                          id: b8f21a71ac8df98d29de357180d27358
                          type: events
                      attendee:
                        data:
                          id: 99da6cb66b5e6b39007690854fd66df9
                          type: memberships
      responses:
        '201':
          description: Attendance
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/event-attendance'
              examples:
                default:
                  value:
                    data:
                      id: 3130b02817a5aab19255fb8f2c9d1ee3
                      type: eventAttendances
                      attributes:
                        createdAt: '2024-10-27T11:48:24+01:00'
                        numberOfAttendees: 1
                        name: Earl McBride
                        price:
                          net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - amount: '2.0'
                            name: VAT
                            rate: '20.0'
                        accountingCode: EVT
                        visibility: public
                      relationships:
                        event:
                          data:
                            id: b8f21a71ac8df98d29de357180d27358
                            type: events
                        attendee:
                          data:
                            id: a8c12f62ac8df98d29de357180d673e1
                            type: memberships
        '409':
          description: In case the member is already attending or the event capacity is reached.
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/failure'
              examples:
                default:
                  value:
                    errors:
                    - detail: Already attending event.
                      source:
                        pointer: /data/relationships/attendee
  /event_attendances/{id}:
    get:
      summary: Single event attendance
      description: 'Get details of a single event attendance.


        **Access**: The current user must be an admin of the space the event belongs to,

        or the event attendee, or a member of the space if the attendance visibility is ''members'',

        or anyone if the attendance has ''public'' visibility.

        '
      operationId: get-event-attendance
      parameters:
      - name: id
        in: path
        required: true
        description: The id of the event attendance to get.
        schema:
          type: string
      - name: include
        in: query
        style: form
        explode: false
        required: false
        description: Include attendee. Requires `read_memberships` and `read_contacts` scope.
        schema:
          type: array
          items:
            type: string
            enum:
            - attendee
      security:
      - OAuth2:
        - read_event_attendances
      tags:
      - Event
      responses:
        '200':
          description: The event attendance.
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/event-attendance'
              examples:
                default:
                  value:
                    data:
                      id: 3130b02817a5aab19255fb8f2c9d1ee3
                      type: eventAttendances
                      attributes:
                        accountingCode: EVT
                        price:
                          net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - amount: '2.0'
                            name: VAT
                            rate: '20.0'
                        visibility: public
                        numberOfAttendees: 1
                        name: Earl McBride
                        createdAt: '2024-10-27T11:48:24+01:00'
                      relationships:
                        event:
                          data:
                            id: b8f21a71ac8df98d29de357180d27358
                            type: events
                        attendee:
                          data:
                            id: a8c12f62ac8df98d29de357180d673e1
                            type: memberships
                    included:
                    - id: a8c12f62ac8df98d29de357180d673e1
                      type: memberships
                      attributes:
                        name: Jane Fonda
                        email: foksol@di.es
                        phone: (746) 760-3432
                        company: null
                        confirmedAt: '2020-02-01'
                        canceledAt: null
                        photo:
                          thumb:
                            url: https://cdn.com/24a99a71ac8df98d29de357180d273d3/thumb_photo.png
                            width: 50
                            height: 50
                          small:
                            url: https://cdn.com/24a99a71ac8df98d29de357180d273d3/small_photo.png
                            width: 120
                            height: 120
                          large:
                            url: https://cdn.com/24a99a71ac8df98d29de357180d273d3/large_photo.png
                            width: 285
                            height: 285
                          xlarge:
                            url: https://cdn.com/24a99a71ac8df98d29de357180d273d3/xlarge_photo.png
                            width: 600
                            height: 600
                          hd:
                            url: https://cdn.com/24a99a71ac8df98d29de357180d273d3/hd_photo.png
                            width: 1200
                            height: 1200
                      relationships:
                        space:
                          data:
                            id: c9a99a71ac8df98d29de357180d273d3
                            type: spaces
                        team:
                          data:
                            id: 4db23e1a-62a6-5115-8034-fc18b13bffac
                            type: teams
    delete:
      summary: Unattend event
      description: 'Unattend an event as member. This refunds the ticket price

        if applicable.


        **Access**: The current user must be connected to the

        membership the attendance belongs to.

        '
      operationId: unattend-event
      parameters:
      - name: id
        in: path
        required: true
        description: The id of the event attendance to delete.
        schema:
          type: string
      security:
      - OAuth2:
        - write_event_attendances
      tags:
      - Event
      responses:
        '204':
          description: Attendance deleted.
        '409':
          description: In case event was not attended or has already started.
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/failure'
              examples:
                default:
                  value:
                    errors:
                    - detail: You are not attending the event / Event has already started.
  /events/{id}/attendances:
    get:
      summary: List attendances
      description: 'List all the attendances for an event. Attendances connect an

        event with a membership or contact and can have an optional price.


        **Access**: The current user must be an admin or member of the space the event belongs to.

        '
      operationId: list-event-attendances
      parameters:
      - name: id
        in: path
        required: true
        description: The id of the event.
        schema:
          type: string
      - name: include
        in: query
        style: form
        explode: false
        required: false
        description: Include attendees. Requires `read_memberships` scope.
        schema:
          type: array
          items:
            type: string
            enum:
            - attendee
      security:
      - OAuth2:
        - read_event_attendances
      tags:
      - Event
      responses:
        '200':
          description: The list of attendances with included attendees (memberships or contacts).
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/event-attendances'
              examples:
                default:
                  value:
                    data:
                    - id: 3130b02817a5aab19255fb8f2c9d1ee3
                      type: eventAttendances
                      attributes:
                        accountingCode: EVT
                        price:
                          net: '10.0'
                          gross: '12.0'
                          currency: EUR
                          taxes:
                          - amount: '2.0'
                            name: VAT
                            rate: '20.0'
                        visibility: public
                        numberOfAttendees: 1
                        name: Earl McBride
                        createdAt: '2024-10-27T11:48:24+01:00'
                      relationships:
                        event:
                          data:
                            id: b8f21a71ac8df98d29de357180d27358
                            type: events
                        attendee:
                          data:
                            id: a8c12f62ac8df98d29de357180d673e1
                            type: memberships
                    - id: abcdb02817a5aab19255fb8f2c9d1ee3
                      type: eventAttendances
                      attributes:
                     

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