Cobot Space API

A coworking space. Spaces can form a network to allow members access to multiple spaces.

OpenAPI Specification

cobot-space-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Cobot Space 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: Space
  description: A coworking space. Spaces can form a network to allow members access to multiple spaces.
paths:
  /spaces/{spaceId}:
    get:
      summary: Get a space
      description: '**Access**: Any user can access any space. Members and admins of the space see more details.

        '
      operationId: get-space
      parameters:
      - name: spaceId
        in: path
        required: true
        description: The id of the space.
        schema:
          type: string
      security:
      - OAuth2:
        - read_spaces
      tags:
      - Space
      responses:
        '200':
          description: Details of the space.
          content:
            application/vnd.api+json:
              schema:
                $ref: '#/components/schemas/space'
              examples:
                default:
                  value:
                    data:
                      id: f9a99a71ac8df98d29de357180d273d3
                      type: spaces
                      attributes:
                        name: co.up
                        email: joe@doe.com
                        description: my space
                        subdomain: co-up
                        createdAt: '2020-04-28'
                        countryCode: DE
                        locale: de-DE
                        logo:
                          pdf:
                            url: https://cdn.com/space/photo/a4a99a71ac8df98d29de357180d273d3/pdf_logo.png
                            width: 400
                            height: 400
                          default:
                            url: https://cdn.com/space/photo/a4a99a71ac8df98d29de357180d273d3/default_logo.png
                            width: 100
                            height: 100
                        inEu: true
                        timeZone: Europe/Berlin
                        defaultTaxes:
                        - name: VAT
                          rate: '10.5'
                        hourFormat: 24
                        priceDisplay: net
                        priceDecimals: 2
                      relationships:
                        owner:
                          data:
                            id: 23c37a61ac8df98d29de357180d273d3
                            type: users
                        network:
                          data:
                            id: 17c37a61ac8df98d29de357180d273d4
                            type: networks
                        availableResources:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/resources/available
                        calendarBlockers:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/calendar_blockers
                        costCenters:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/cost_centers
                        revenueAccounts:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/revenue_accounts
                        products:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/products
                        resources:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/resources
                        bookings:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/bookings
                        allocations:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/allocations
                        dropInPasses:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/drop_in_passes
                        externalBookingsPaymentMethods:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/external_bookings_payment_methods
                        events:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/events
                        externalBookings:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/external_bookings
                        externalResources:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/external_resources
                        membershipProfiles:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/membership_profiles
                        teams:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/teams
                        urls:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/urls
                        spaceProfile:
                          links:
                            related: https://api.cobot.me/spaces_profiles/a2a89a71ac8df98d29de357180d273c8
                        membershipProfile:
                          data:
                            type: membershipProfiles
                            id: 21a4fa61ac8df94d29de357180d271a8
                        accessToken:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/access_token
                        paymentMethods:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/payment_methods
                        missingTermsApproval:
                          links:
                            related: https://api.cobot.me/spaces/f9a99a71ac8df98d29de357180d273d3/membership/terms_approval/missing
components:
  schemas:
    relationship-linkage:
      type: object
      required:
      - data
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/linkage'
    related-link:
      type: object
      required:
      - links
      additionalProperties: false
      properties:
        links:
          type: object
          required:
          - related
          additionalProperties: false
          properties:
            related:
              type: string
              format: uri-reference
    decimal:
      description: A decimal number.
      type: string
      pattern: ^-?\d+(\.\d+)?$
    photo:
      type: object
      properties:
        url:
          type: string
          format: uri-reference
        width:
          type: number
        height:
          type: number
      additionalProperties: false
    -space-data:
      id: -space-data.json
      type: object
      required:
      - id
      - type
      additionalProperties: false
      properties:
        id:
          type: string
        type:
          type: string
          enum:
          - spaces
        attributes:
          type: object
          required:
          - name
          - subdomain
          - createdAt
          - email
          - countryCode
          - locale
          - description
          - inEu
          - timeZone
          - hourFormat
          - priceDisplay
          - priceDecimals
          - logo
          - defaultTaxes
          additionalProperties: false
          properties:
            createdAt:
              $ref: '#/components/schemas/date'
            email:
              type: string
            name:
              type: string
            subdomain:
              type: string
            description:
              oneOf:
              - type: string
              - type: 'null'
            countryCode:
              type: string
              description: Two letter country code, e.g. DE for Germany.
            locale:
              type: string
              description: The default locale (language), e.g. en-US.
            logo:
              oneOf:
              - type: object
                properties:
                  pdf:
                    $ref: '#/components/schemas/photo'
                  icon152:
                    $ref: '#/components/schemas/photo'
                  icon32:
                    $ref: '#/components/schemas/photo'
                  default:
                    $ref: '#/components/schemas/photo'
                additionalProperties: false
              - type: 'null'
            inEu:
              type: boolean
              description: Whether the space is in the European Union.
            defaultTaxes:
              description: The taxes that apply to all charges exept where overridden.
              type: array
              items:
                type: object
                additionalProperties: false
                properties:
                  name:
                    type: string
                  rate:
                    $ref: '#/components/schemas/decimal'
            timeZone:
              type: string
            hourFormat:
              type: integer
              enum:
              - 12
              - 24
              description: Whether to show times in 12 or 24h system.
            priceDisplay:
              type: string
              enum:
              - net
              - gross
              description: Whether to show prices as net or gross (without/with taxes included).
            priceDecimals:
              type: integer
              description: No. of decimal points to use when showing prices.
        relationships:
          type: object
          additionalProperties: false
          required:
          - allocations
          - availableResources
          - calendarBlockers
          - costCenters
          - revenueAccounts
          - events
          - resources
          - bookings
          - accessToken
          - products
          - paymentMethods
          properties:
            availableExternalResources:
              $ref: '#/components/schemas/related-link'
            availableResources:
              $ref: '#/components/schemas/related-link'
            calendarBlockers:
              $ref: '#/components/schemas/related-link'
            costCenters:
              $ref: '#/components/schemas/related-link'
            revenueAccounts:
              $ref: '#/components/schemas/related-link'
            products:
              $ref: '#/components/schemas/related-link'
            resources:
              $ref: '#/components/schemas/related-link'
            externalResources:
              $ref: '#/components/schemas/related-link'
            bookings:
              $ref: '#/components/schemas/related-link'
            allocations:
              $ref: '#/components/schemas/related-link'
            dropInPasses:
              $ref: '#/components/schemas/related-link'
            events:
              $ref: '#/components/schemas/related-link'
            externalBookings:
              $ref: '#/components/schemas/related-link'
            urls:
              $ref: '#/components/schemas/related-link'
            membershipProfiles:
              $ref: '#/components/schemas/related-link'
            membershipProfile:
              $ref: '#/components/schemas/relationship-linkage'
            teams:
              $ref: '#/components/schemas/related-link'
            spaceProfile:
              $ref: '#/components/schemas/related-link'
            accessToken:
              $ref: '#/components/schemas/related-link'
            owner:
              $ref: '#/components/schemas/relationship-linkage'
            missingTermsApproval:
              $ref: '#/components/schemas/related-link'
            network:
              $ref: '#/components/schemas/relationship-linkage'
            externalBookingsPaymentMethods:
              $ref: '#/components/schemas/related-link'
            paymentMethods:
              $ref: '#/components/schemas/related-link'
    date:
      description: A date in the form YYYY-MM-DD.
      type: string
      pattern: ^\d{4}-\d{2}-\d{2}$
    linkage:
      description: The "type" and "id" of a linked entity.
      type: object
      required:
      - type
      - id
      properties:
        type:
          type: string
        id:
          type: string
      additionalProperties: false
    space:
      id: space.json#
      type: object
      required:
      - data
      additionalProperties: false
      properties:
        data:
          $ref: '#/components/schemas/-space-data'
  securitySchemes:
    OpenId:
      type: openIdConnect
      openIdConnectUrl: https://www.cobot.me/.well-known/openid-configuration
    OAuth2:
      type: oauth2
      description: "OAuth is \"an open protocol to allow secure API authorization in a simple and\nstandard method from desktop and web applications.\". \"OAuth 2.0 is the\nnext evolution of the OAuth protocol [..]. OAuth 2.0 focuses on client\ndeveloper simplicity [...]. It is supported by many popular sites such as\nFacebook and there are client libraries available for many programming\nlanguages.\n\nFor information about OAuth2 see the [oauth website](http://oauth.net/2/).\n\n**For OAuth2 you need a client id and secret. In order to get those you have\nto [register your application](/oauth2_clients).**\n\nAPI authorization works by passing a bearer token via the HTTP Authorization header:\n\n    Authorization: bearer <token>\n\n## Permissions (Scope)\n\nOAuth2 [defines scopes](https://tools.ietf.org/html/rfc6749#section-3.3) to\nrestrict access to certain resources.\n\nThe required scope for each resource can be found within the documentation\nfor each endpoint.\n\nPlease note that a user's scope can be limited when they access the API as\nan admin of a space and some of their admin permissions have been revoked.\n"
      flows:
        authorizationCode:
          authorizationUrl: https://www.cobot.me/oauth/authorize
          tokenUrl: https://www.cobot.me/oauth/access_token
          scopes:
            read_articles: Read help desk articles.
            read_allocations: Read resource allocation data.
            read_booking_credits: Read information about a membership's booking credits.
            read_bookings: Read booking data.
            read_built_in_email_customizations: Read built in email customizations.
            read_calendar_blockers: Read calendar blockers.
            read_check_ins: Read memberships' check-in data.
            read_contacts: Read contacts.
            read_drop_in_passes: Read drop-in passes.
            read_drop_in_pass_templates: Read drop-in pass templates.
            read_discount_codes: Read discount codes.
            read_event_attendances: Read who is attending an event.
            read_event_messages: Read messages sent about events.
            read_events: Read events of a space.
            read_external_bookings: Read external booking data.
            read_external_resources: Read resources enabled for external booking.
            read_invoices: Read invoices created for a membership in a space.
            read_memberships: Read information about memberships in a space.
            read_teams: Read information about teams in a space.
            read_membership_profiles: Read members' profile data.
            read_navigation_links: Read/list navigation links for a space.
            read_payment_methods: Read payment methods in order to process payments.
            read_published_membership_profiles: Read published members' profile data.
            read_networks: Read information about a network.
            read_products: Read information about products.
            read_resource_categories: Read information about booking calendar categories.
            read_resources: Read information about booking calendar resources.
            read_single_page_apps: Read information about single page apps.
            read_space_profiles: Read space profile information.
            read_spaces: Read basic space information.
            read_space_billing_details: Read information relevant to billing the space.
            read_space_payment_method: Read a space's payment method used to pay for the space's Cobot subscription.
            read_space_subscriptions: Read a space's subscription.
            read_terms_approvals: Shows missing approvals for the current member.
            read_urls: Read the URLs to the Cobot web interface.
            read_user: Read the current user's information.
            write_bookings: Write booking data.
            write_check_ins: Check a member in at a space.
            write_customers: Convert a space to a customer.
            write_drop_in_pass_purchases: Create drop-in pass purchases.
            write_drop_in_passes: Cancel drop-in passes.
            write_event_ticket_purchases: Create event ticket purchases.
            write_event_attendances: Attend/unattend events.
            write_event_messages: Create/update messages sent about events.
            write_events: Write to events of a space.
            write_external_bookings: Create/update bookings as a non-member.
            write_external_resources: Create/update/delete resources enabled for non-memberss
            write_resources: Create/update/delete booking calendar resources.
            write_invoices: Create invoices for members in a space.
            write_invoice_reminders: Send invoice reminder emails.
            write_membership_profiles: Manage the social profiles of members.
            write_navigation_links: Create/update/delete navigation links for a space.
            write_payments: Initiate payments for external bookings.
            write_single_page_apps: Create and update single page apps to be embedded on Cobot.
            write_space_billing_details: Update a space's billing details.
            write_space_payment_method: Update a space's payment method used to pay for the space's Cobot subscription.
            write_space_subscriptions: Change a space's subscription. Only trusted clients can request this scope. Contact support.
            write_terms_approvals: Approve different kinds of terms as a member.