Pleo Gjoll API

Core accounting-entry and tagging API covering tag groups, tags, tax codes, and accounting entries with enrichment and search.

OpenAPI Specification

pleo-gjoll-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Gjoll API
  description: Gjoll OpenAPI definitions
  termsOfService: https://pleo.io/terms/
  contact:
    email: [email protected]
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 82.3.2
servers:
- url: https://external.pleo.io
  description: Production server
- url: https://external.staging.pleo.io
  description: Staging server
security:
- bearerAuth: []
- basicAuth: []
tags:
- name: reconciliation
  description: Reconciliation API
- name: accounts
  description: Accounts API
- name: categories
  description: Categories API
- name: tax-codes
  description: Tax Codes API
- name: accounting-entries
  description: "The Accounting Entries API endpoints enable you to perform the following:\n\
    \  - Apply filters and search for accounting entries and accounting receipts.\n\
    \  - Retrieve list of accounting entries and accounting receipts.\n  - Retrieve\
    \ details of a specific accounting entry."
paths:
  /v0/aggregations/tag-groups:
    get:
      tags:
      - tag-groups
      summary: Retrieve the tag groups for a company or an organisation in aggregated
        format
      description: "\n            ⚠️ Attention: either the `company_id` or the `organization_id`\
        \ query parameter MUST be provided. \n            If you supply both, the\
        \ `company_id` will be used. If you supply neither, the request will fail.\
        \ \n            If you supply the `company_id`, the response will contain\
        \ only the tag groups for that company.\n            If you supply the `organization_id`,\
        \ the response will contain the tag groups for all companies in the organization.\n\
        \            If you supply the `company_id` and the `organization_id`, the\
        \ response will contain only the tag groups for the company. \n          \
        \  If you supply the `tag_group_ids` query parameter, the response will contain\
        \ only the tag groups with the given ids, including archived ones.\n     \
        \       "
      operationId: getAggregatedTagGroups
      parameters:
      - name: company_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Enter the company ID whose tag groups you are searching for.
            Required if organization_id is not provided. If you enter both company_id
            and organization_id, the company_id is used to filter the tag groups.
          format: uuid
      - name: organization_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Enter the organization ID whose tag groups you are searching
            for. Required if company_id is not provided. If you enter both company_id
            and organization_id, the company_id is used to filter the tag groups.
          format: uuid
      - name: tag_group_ids
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: array
          description: Enter the list of tag groups IDs that you are searching for.
          items:
            type: string
            description: Enter the list of tag groups IDs that you are searching for.
            format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseListAggregatedTagGroupModel'
  /v0/aggregations/tags:
    post:
      tags:
      - tags
      summary: Retrieve tags in aggregated format
      description: Retrieve tags for a company in aggregated format.
      operationId: searchAggregatedTags
      parameters:
      - name: company_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Unique identifier of the company whose tags you are searching
            for.
          format: uuid
      - name: before
        in: query
        description: Lower bound of the page of data to return (cannot be used together
          with [after] or [offset]).
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: after
        in: query
        description: Upper bound of the page of data to return (cannot be used together
          with [before] or [offset]).
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: offset
        in: query
        description: Offset of the page of data to return (cannot be used together
          with [before] or [after]).
        required: false
        style: form
        explode: true
        schema:
          type: integer
          format: int64
      - name: limit
        in: query
        description: The maximum amount of items to return.
        required: false
        style: form
        explode: true
        schema:
          type: integer
          format: int32
      - name: sorting_keys
        in: query
        description: The keys to sort the results by.
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: sorting_order
        in: query
        description: The order to sort the results by. Must be the same length as
          [sortingKeys]; one order per key.
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PageOrder'
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/CompositeTagSearchRequest'
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/CursorPaginatedResponseAggregatedTagModel'
  /v0/tag-groups:
    get:
      tags:
      - tag-groups
      summary: Retrieve tag groups for a company or an organisation
      description: "\n            ⚠️ Attention: either the `company_id` or the `organization_id`\
        \ query parameter MUST be provided.\n            If you supply both, the `company_id`\
        \ will be used. If you supply neither, the request will fail.\n          \
        \  If you supply the `company_id`, the response will contain only the tag\
        \ groups for that company. \n            If you supply the `organization_id`,\
        \ the response will contain the tag groups for all companies in the organization.\n\
        \            If you supply the `company_id` and the `organization_id`, the\
        \ response will contain only the tag groups for the company.\n            "
      operationId: getTagGroups
      parameters:
      - name: company_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Enter the company ID whose tag groups you are searching for.
            Required if organization_id is not provided. If you enter both company_id
            and organization_id, the company_id is used to filter the tag groups.
          format: uuid
      - name: organization_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Enter the organization ID whose tag groups you are searching
            for. Required if company_id is not provided. If you enter both company_id
            and organization_id, the company_id is used to filter the tag groups.
          format: uuid
      - name: include_archived
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: include_tags_count
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseListTagGroupModel'
    post:
      tags:
      - tag-groups
      summary: Create a new tag group
      description: Create a new tag group in Pleo.
      operationId: createTagGroup
      parameters:
      - name: company_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Unique identifier of the company the tag group will be associated
            with.
          format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/TagGroupCreateModel'
        required: true
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagGroupModel'
  /v0/tag-groups/{groupId}:
    get:
      tags:
      - tag-groups
      summary: Retrieve a tag group by its id
      description: Retrieve details of a tag group by its id.
      operationId: getTagGroup
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group to retrieve.
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagGroupModel'
    put:
      tags:
      - tag-groups
      summary: Update a tag group
      description: Modify details of a tag group by its id.
      operationId: updateTagGroup
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group to update.
          format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/TagGroupUpdateModel'
        required: true
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagGroupModel'
    delete:
      tags:
      - tag-groups
      summary: Delete a tag group
      description: Delete a tag group by its id.
      operationId: deleteTagGroup
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group to delete.
          format: uuid
      responses:
        '204':
          description: Tag group successfully removed.
  /v0/tag-groups/{groupId}/dimensions:
    get:
      tags:
      - tag-groups
      summary: Retrieve a list of tag group dimensions
      description: "\n            Retrieve a list of tag group dimensions excluding\
        \ the name and code dimensions which are always present in a tag group. \n\
        \            The name and code dimensions are returned only when they do not\
        \ follow the standard name and code naming convention.\n            "
      operationId: getTagGroupDimensions
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group to fetch dimensions for.
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseListTagGroupDimensionModel'
    post:
      tags:
      - tag-groups
      summary: Create a new tag group dimension
      operationId: createTagGroupDimension
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group this dimension will be associated
            with.
          format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/TagGroupDimensionCreateModel'
        required: true
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagGroupDimensionModel'
  /v0/tag-groups/{groupId}/dimensions/{dimensionId}:
    get:
      tags:
      - tag-groups
      summary: Retrieve a tag group dimension
      operationId: getTagGroupDimension
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group this dimension belongs to.
          format: uuid
      - name: dimensionId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group dimension to be retrieved.
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagGroupDimensionModel'
    put:
      tags:
      - tag-groups
      summary: Update a tag group dimension
      description: Update a tag group dimension by its id.
      operationId: updateTagGroupDimension
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group this dimension belongs to.
          format: uuid
      - name: dimensionId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group dimension to be updated.
          format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/TagGroupDimensionUpdateModel'
        required: true
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagGroupDimensionModel'
    delete:
      tags:
      - tag-groups
      summary: Delete a tag group dimension
      operationId: deleteTagGroupDimension
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group this dimension belongs to.
          format: uuid
      - name: dimensionId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group dimension to be deleted.
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8: {}
  /v0/tag-groups/{groupId}/tags:
    get:
      tags:
      - tags
      summary: Retrieve tags for a tag group
      description: Retrieve a list of tags associated with a tag group.
      operationId: getTags
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group.
          format: uuid
      - name: before
        in: query
        description: Lower bound of the page of data to return (cannot be used together
          with [after] or [offset]).
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: after
        in: query
        description: Upper bound of the page of data to return (cannot be used together
          with [before] or [offset]).
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: offset
        in: query
        description: Offset of the page of data to return (cannot be used together
          with [before] or [after]).
        required: false
        style: form
        explode: true
        schema:
          type: integer
          format: int64
      - name: limit
        in: query
        description: The maximum amount of items to return.
        required: false
        style: form
        explode: true
        schema:
          type: integer
          format: int32
      - name: sorting_keys
        in: query
        description: The keys to sort the results by.
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: sorting_order
        in: query
        description: The order to sort the results by. Must be the same length as
          [sortingKeys]; one order per key.
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PageOrder'
      - name: include_archived
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: boolean
          description: Boolean flag to determine whether archived tags should be included.
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/CursorPaginatedResponseTagModel'
    post:
      tags:
      - tags
      summary: Create a new tag for a tag group
      description: Create a new tag for a tag group in Pleo.
      operationId: createTag
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group.
          format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/TagCreateModel'
        required: true
      responses:
        '201':
          description: Tag created successfully.
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagModel'
        '400':
          description: Tag group already contains maximum number of active tags.
        '409':
          description: 'Conflict: tag with the same `code` already exists in Pleo.'
  /v0/tag-groups/{groupId}/usage:
    get:
      tags:
      - tag-groups
      summary: Get usage for a tag group
      description: Returns the number of expenses that are linked to each tag within
        a tag group.
      operationId: getTagGroupUsage
      parameters:
      - name: groupId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag group to get usage for.
          format: uuid
      responses:
        '200':
          description: Tag group usage successfully retrieved.
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagGroupUsageModel'
        '403':
          description: 'Forbidden: User lacks the necessary permissions.'
        '404':
          description: 'Not found: Tag group with given id was not found or deleted.'
  /v0/tags:
    get:
      tags:
      - tags
      summary: Search tags
      operationId: searchTags
      parameters:
      - name: company_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          format: uuid
      - name: text_search
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: tag_group_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
            format: uuid
      - name: include_archived
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: boolean
      - name: before
        in: query
        description: Lower bound of the page of data to return (cannot be used together
          with [after] or [offset]).
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: after
        in: query
        description: Upper bound of the page of data to return (cannot be used together
          with [before] or [offset]).
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: offset
        in: query
        description: Offset of the page of data to return (cannot be used together
          with [before] or [after]).
        required: false
        style: form
        explode: true
        schema:
          type: integer
          format: int64
      - name: limit
        in: query
        description: The maximum amount of items to return.
        required: false
        style: form
        explode: true
        schema:
          type: integer
          format: int32
      - name: sorting_keys
        in: query
        description: The keys to sort the results by.
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: sorting_order
        in: query
        description: The order to sort the results by. Must be the same length as
          [sortingKeys]; one order per key.
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            $ref: '#/components/schemas/PageOrder'
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/CursorPaginatedResponseTagModel'
      deprecated: true
    delete:
      tags:
      - tags
      summary: Bulk delete tags
      description: Bulk delete tags for a company
      operationId: bulkDeleteTags
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/BulkTagDeleteModel'
        required: true
      responses:
        '204':
          description: Tags deleted successfully
  /v0/tags/archive:
    post:
      tags:
      - tags
      summary: Bulk archive or unarchive Tags
      description: Bulk archive or unarchive Tags for a company
      operationId: bulkArchiveTags
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/BulkTagArchiveModel'
        required: true
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseListTagModel'
  /v0/tags/{tagId}:
    get:
      tags:
      - tags
      summary: Retrieve a tag by its id
      description: Retrieve details of a tag by its id.
      operationId: getTag
      parameters:
      - name: tagId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag to retrieve.
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagModel'
    put:
      tags:
      - tags
      summary: Update a tag
      description: Modify details of a tag by its id.
      operationId: updateTag
      parameters:
      - name: tagId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag to update.
          format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/TagUpdateModel'
      responses:
        '200':
          description: Tag updated successfully.
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagModel'
        '404':
          description: Tag not found.
        '409':
          description: 'Conflict: update to tag changes the code to use an existing
            one.'
    delete:
      tags:
      - tags
      summary: Delete a tag
      description: Delete a tag by its id.
      operationId: deleteTag
      parameters:
      - name: tagId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          description: Unique identifier of the tag to delete.
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8: {}
  /v0/tags/{tagId}/dimensions:
    get:
      tags:
      - tags
      summary: Retrieve dimension values
      description: Retrieve a list of dimension values for a tag.
      operationId: getTagDimensionValues
      parameters:
      - name: tagId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseListTagDimensionValueModel'
  /v0/tags/{tagId}/dimensions/{dimensionId}:
    get:
      tags:
      - tags
      summary: Retrieve a dimension value
      operationId: getDimensionValue
      parameters:
      - name: tagId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      - name: dimensionId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagDimensionValueModel'
    put:
      tags:
      - tags
      summary: Update a dimension value
      description: Update a dimension value for a tag.
      operationId: updateDimensionValue
      parameters:
      - name: tagId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      - name: dimensionId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/TagDimensionValueUpdateModel'
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagDimensionValueModel'
    post:
      tags:
      - tags
      summary: Create a new dimension value
      description: Create a new dimension value for a tag.
      operationId: createDimensionValue
      parameters:
      - name: tagId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      - name: dimensionId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      requestBody:
        content:
          application/json;charset=UTF-8:
            schema:
              $ref: '#/components/schemas/TagDimensionValueCreateModel'
        required: true
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagDimensionValueModel'
    delete:
      tags:
      - tags
      summary: Delete a dimension value
      description: Delete a dimension value for a tag.
      operationId: deleteDimensionValue
      parameters:
      - name: tagId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      - name: dimensionId
        in: path
        required: true
        style: simple
        explode: false
        schema:
          type: string
          format: uuid
      responses:
        default:
          description: default response
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/DataResponseTagDimensionValueModel'
  /v0/tags:search:
    post:
      tags:
      - tags
      summary: Search tags
      operationId: searchTagsPost
      parameters:
      - name: company_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          description: Unique identifier of the company whose tags you are searching
            for.
          format: uuid
      - name: organization_id
        in: query
        required: false
        style: form
        explode: true
        schema:
          type: string
          format: uuid
      - name: before
        in: query
        description: Lower bound of the page of data to return (cannot be used together
          with [after] or [offset]).
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: after
        in: query
        description: Upper bound of the page of data to return (cannot be used together
          with [before] or [offset]).
        required: false
        style: form
        explode: true
        schema:
          type: string
      - name: offset
        in: query
        description: Offset of the page of data to return (cannot be used together
          with [before] or [after]).
        required: false
        style: form
        explode: true
        schema:
          type: integer
          format: int64
      - name: limit
        in: query
        description: The maximum amount of items to return.
        required: false
        style: form
        explode: true
        schema:
          type: integer
          format: int32
      - name: sorting_keys
        in: query
        description: The keys to sort the results by.
        required: false
        style: form
        explode: true
        schema:
          type: array
          items:
            type: string
      - name: sorting_order
        in: query
        description: The order to sort the results by. Must be the same length as
          [sortingKeys]; one order per key.
        required: false
        st

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