openapi: 3.0.4 info: title: Bench AccountActivities ProjectFields API description: "

Versioning

\n

\n The API is currently at version 1.0. All API endpoints (other than\n authentication) require you to specify the API version as part of the path.\n

\n\n

URL Paths

\n

\n Authentication requests should be made to /auth/signin,\n as documented below. All other API requests should be made to\n sub-paths of /rp/api/1.0/....\n

\n\n

Authentication

\n

\n API requests are authenticated using an OAuth Bearer token.\n You can get a token by authenticating your user by sending a\n POST request to /auth/signin, with \"username and \"password\"\n parameters form-encoded in the body of the request.\n\n POST /auth/signin HTTP/1.1\n Content-Type: application/x-www-form-urlencoded\n\n username=user@example.com&password=some-secret-password\n

\n

\n The response will be a JSON object including both\n \"access_token\" and \"refresh_token\" property.\n All other requests against the Bench API should include an\n authorization header: Authorization: Bearer xxxYYYzzz,\n where xxxYYYzzz is the value of \"access_token\" in the response.\n

\n For example:\n\n $ curl https://bench.gobridgit.com/auth/signin -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'username=someone@example.com' --data-urlencode 'password=[...snip...]'\n {\n \"access_token\": \"...snip...\",\n \"token_type\": \"Bearer\",\n \"refresh_token\": \"...snip...\"\n \"expiry\": \"2020-01-01T00:00:00.413440849Z\"\n }\n\n

\n\n

\n The refresh token can be used to generate new session by request with /auth/token endpoint:\n\n POST /auth/token HTTP/1.1\n Content-Type: application/x-www-form-urlencoded\n\n grant_type=refresh_token&refresh_token=tGzv3JOkF0XG5Qx2TlKWIA\n

\n

\n Note that once the refresh token is used, the previous access and refresh token is no longer valid.\n

\n For example:\n\n $ curl https://bench.gobridgit.com/auth/token -H 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=refresh_token' --data-urlencode 'refresh_token=[...snip...]'\n {\n \"access_token\": \"...snip...\",\n \"token_type\": \"Bearer\",\n \"refresh_token\": \"...snip...\"\n \"expiry\": \"2020-01-01T00:00:00.413440849Z\"\n }\n

\n\n

Pagination

\n

\n Several of the API endpoints are paginated. These are denoted by\n including the offset (zero-based offset) and limit query\n parameters. For example, to request the 10 items,\n set the offset=0 to limit=10.\n
\n NOTE: the result set contains items with index of 0-9\n
\n To request the next 10 items (starting at index 10),\n set the offset=10 to limit=10\n

\n

\n Responses to paginated API endpoints return a JSON array of objects.\n If there are results beyond the page you have requested, the server\n will set a query-has-more: true header in the response.\n

\n\n

Request Encoding

\n

\n GET and DELETE requests should have parameters encoded as URL query\n parameters. Boolean values should be encoded as true and\n false, not as 1 and 0.\n

\n\n

Errors

\n

\n Errors are returned for some response codes such as 400 Bad Request in the\n following format:\n\n {\n \"errors\": [\n {\n \"errorType\": \"ValidationError\",\n \"description\": \"The value of Name must be a string with a minimum length of 1 and a maximum length of 8 and not whitespace.\",\n \"field\": \"Name\",\n \"values\": [\n null\n ]\n }\n ],\n \"title\": \"One or more validation errors occurred.\",\n \"status\": 400,\n \"instance\": \"api/v1/accounts/0/persons\",\n \"requestUid\": \"123e4567-e89b-12d3-a456-426614174000\"\n }\n

\n" version: '1.0' servers: - url: https://bench.gobridgit.com description: Bridgit Bench production security: - {} tags: - name: ProjectFields paths: /rp/api/v1/accounts/{id}/project-fields: get: tags: - ProjectFields summary: Gets all project field definitions in the given account. description: '
Permissions
Account: Read
Private: Read
Finance: Read' operationId: ProjectFields_Query parameters: - name: id in: path description: The Account ID required: true schema: type: integer format: int32 responses: '200': description: 'Success: List of field definitions' content: text/plain: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' application/json: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' text/json: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden post: tags: - ProjectFields summary: Adds or updates field definitions on the given account description: 'If you pass in a FieldDefRequest object without an "id" this endpoint will add a new one to the account if the name isn''t reserved or in use. If you pass in a FieldDefRequest object with an "id" this endpoint will update an existing one that matches the id. To add a value or multiple values to a selection list you must pass an array of "definedValues" that contain objects with a "definedValue" property of the value you want to add. To update a value or multiple values in a selection list you must pass an array of "definedValues" that contain objects with a "valueId" property of the value id to update and a "definedValue" property of the value you want to update it to. To remove a value or multiple values from a selection list you must pass an array of "definedValues" that contain objects with a "valueId" property of the value id to remove, a "definedValue" property of the value you want to remove, and a "forRemoval" property set to true. Example: You have a list of "Years" and you want to change "5" to "5-9" and remove values "6" through "9" and add a value of "10+" [
  {
    "id": 123,
    "name": "Years",
    "type": "SingleSelect",
    "definedValues": [
      {
        "valueId": 584,
        "definedValue": "5-9",
        "forRemoval": false,
        "deleteExperienceFieldValues": false
      },
      {
        "valueId": 585,
        "definedValue": "6",
        "forRemoval": true,
        "deleteExperienceFieldValues": false
      },
      {
        "valueId": 586,
        "definedValue": "7",
        "forRemoval": true,
        "deleteExperienceFieldValues": false
      },
      {
        "valueId": 587,
        "definedValue": "8",
        "forRemoval": true,
        "deleteExperienceFieldValues": false
      },
      {
        "valueId": 588,
        "definedValue": "9",
        "forRemoval": true,
        "deleteExperienceFieldValues": false
      },
      {
        "valueId": 0,
        "definedValue": "10+",
        "forRemoval": false,
        "deleteExperienceFieldValues": false
      }
    ],
    "isRequired": true,
    "isPrivate": false,
    "isLocked": false
  }
]
NOTE: There are a few reserved field names that cannot be used. "Project ID", "Project Name", "Colour", "Start Date", "End Date", "Roles", "Status", "Active Phase", "Issues", "Allocated People", "Notes", "Group"

Validation

Other: Free text. Max length: 2400 Address: Free text. Max length: 250 Project Number: Free text. Max length: 250 Budget: Currency. Starts with 0 to 15 digits of ```0-9``` then optionally followed by ```.``` with 0 to 2 digits of ```0-9``` External ID: Free text. Max length: 250 Labor Hours (Salaried): Positive integer. Must be greater than 0 and not exceed 2,147,483,647 (Int32.MaxValue). Decimals are not allowed. This is a system field that requires both Project Forecasting and Standard modules to be enabled. Labor Hours (Hourly): Positive integer. Must be greater than 0 and not exceed 2,147,483,647 (Int32.MaxValue). Decimals are not allowed. This is a system field that requires both Project Forecasting and Hourly Profile modules to be enabled.
Permissions
Account: Write
Private: Read
Finance: Read' operationId: ProjectFields_Post parameters: - name: id in: path description: The Account ID required: true schema: type: integer format: int32 requestBody: description: Array of field definition request objects content: application/json-patch+json: schema: minItems: 1 type: array items: $ref: '#/components/schemas/FieldDefRequest' example: - id: 123 name: Years type: SingleSelect definedValues: - valueId: 584 definedValue: 5-9 forRemoval: false deleteExperienceFieldValues: false - valueId: 585 definedValue: '6' forRemoval: true deleteExperienceFieldValues: false - valueId: 586 definedValue: '7' forRemoval: true deleteExperienceFieldValues: false - valueId: 587 definedValue: '8' forRemoval: true deleteExperienceFieldValues: false - valueId: 588 definedValue: '9' forRemoval: true deleteExperienceFieldValues: false - valueId: 0 definedValue: 10+ forRemoval: false deleteExperienceFieldValues: false isRequired: true isPrivate: false isLocked: false application/json: schema: minItems: 1 type: array items: $ref: '#/components/schemas/FieldDefRequest' example: - id: 123 name: Years type: SingleSelect definedValues: - valueId: 584 definedValue: 5-9 forRemoval: false deleteExperienceFieldValues: false - valueId: 585 definedValue: '6' forRemoval: true deleteExperienceFieldValues: false - valueId: 586 definedValue: '7' forRemoval: true deleteExperienceFieldValues: false - valueId: 587 definedValue: '8' forRemoval: true deleteExperienceFieldValues: false - valueId: 588 definedValue: '9' forRemoval: true deleteExperienceFieldValues: false - valueId: 0 definedValue: 10+ forRemoval: false deleteExperienceFieldValues: false isRequired: true isPrivate: false isLocked: false text/json: schema: minItems: 1 type: array items: $ref: '#/components/schemas/FieldDefRequest' example: - id: 123 name: Years type: SingleSelect definedValues: - valueId: 584 definedValue: 5-9 forRemoval: false deleteExperienceFieldValues: false - valueId: 585 definedValue: '6' forRemoval: true deleteExperienceFieldValues: false - valueId: 586 definedValue: '7' forRemoval: true deleteExperienceFieldValues: false - valueId: 587 definedValue: '8' forRemoval: true deleteExperienceFieldValues: false - valueId: 588 definedValue: '9' forRemoval: true deleteExperienceFieldValues: false - valueId: 0 definedValue: 10+ forRemoval: false deleteExperienceFieldValues: false isRequired: true isPrivate: false isLocked: false application/*+json: schema: minItems: 1 type: array items: $ref: '#/components/schemas/FieldDefRequest' example: - id: 123 name: Years type: SingleSelect definedValues: - valueId: 584 definedValue: 5-9 forRemoval: false deleteExperienceFieldValues: false - valueId: 585 definedValue: '6' forRemoval: true deleteExperienceFieldValues: false - valueId: 586 definedValue: '7' forRemoval: true deleteExperienceFieldValues: false - valueId: 587 definedValue: '8' forRemoval: true deleteExperienceFieldValues: false - valueId: 588 definedValue: '9' forRemoval: true deleteExperienceFieldValues: false - valueId: 0 definedValue: 10+ forRemoval: false deleteExperienceFieldValues: false isRequired: true isPrivate: false isLocked: false required: true responses: '200': description: 'Success: Added/updated field definitions' content: text/plain: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' application/json: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' text/json: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' '400': description: 'Bad Request: Example when trying to set system fields to private that aren''t allowed to be private: {
  "errors": [
    {
      "errorType": "CannotBeMadePrivate",
      "description": "Fields in request cannot be made private.",
      "errorCode": null,
      "field": "Id",
      "values": [
        "5"
      ],
      "innerException": null,
      "hResult": -2146233088
    }
  ],
  "title": "One or more validation errors occurred.",
  "status": 400,
  "instance": "/api/v1/accounts/2/project-fields",
  "requestUid": "3dd10d1b-392f-4d5a-b736-50ea1f072342"
}
' '401': description: Unauthorized '403': description: Forbidden '409': description: "Conflict - Field definition with name already exists in the account or trying to add or update a field to a system field.\n\n Example when trying to add a field that has the same name as an existing one:\n{
  \"errors\": [
    {
      \"errorType\": \"Duplicate\",
      \"description\": \"A name in the request is already in use.\",
      \"errorCode\": null,
      \"innerException\": null,
      \"hResult\": -2146233088
    }
  ],
  \"title\": \"One or more validation errors occurred.\",
  \"status\": 409,
  \"instance\": \"/api/v1/accounts/2/project-fields\",
  \"requestUid\": \"8ba8f060-858b-46d9-b3cc-fa1c391ebc66\"
}
" '422': description: "Unprocessable Entity - Couldn't remove all defined values from list.\n\n Example when trying to remove a defined value in use from a required list:\n{
  \"errors\": [
    {
      \"errorType\": \"DefinedValueError\",
      \"description\": \"23001: Cannot remove field defined value. It is in use for required field(s)\",
      \"errorCode\": null,
      \"innerException\": null,
      \"hResult\": -2146233088
    }
  ],
  \"title\": \"One or more validation errors occurred.\",
  \"status\": 422,
  \"instance\": \"/api/v1/accounts/2/project-fields\",
  \"requestUid\": \"fb8b2dd9-360f-4a81-852c-e5b70cfa5a85\"
}
" delete: tags: - ProjectFields summary: Removes project field definitions in the given account. description: '
Permissions
Account: Write' operationId: ProjectFields_Delete parameters: - name: id in: path description: The Account ID required: true schema: type: integer format: int32 requestBody: description: The Field Definition IDs content: application/json-patch+json: schema: minItems: 1 type: array items: type: integer format: int64 application/json: schema: minItems: 1 type: array items: type: integer format: int64 text/json: schema: minItems: 1 type: array items: type: integer format: int64 application/*+json: schema: minItems: 1 type: array items: type: integer format: int64 required: true responses: '204': description: No Content '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden '422': description: "Unprocessable Entity: Attempted to remove system field(s)\n\n Example Response:\n{
  \"errors\": [
    {
      \"errorType\": \"NotAllowed\",
      \"description\": \"Cannot delete system field(s)\",
      \"errorCode\": null,
      \"innerException\": null,
      \"hResult\": -2146233088
    }
  ],
  \"title\": \"One or more validation errors occurred.\",
  \"status\": 422,
  \"instance\": \"/api/v1/accounts/2/project-fields\",
  \"requestUid\": \"3b3cbfaa-a809-4529-8870-317654a3311e\"
}
" /rp/api/v1/accounts/{id}/project-fields/_reorder: put: tags: - ProjectFields summary: Update the display order of project field definitions for the given account. description: 'Accepts an array of objects containing fieldId and displayOrder. System fields cannot be reordered and should not be included in the request. All custom fields should be included with their new display order values.
Permissions
Account: Write' operationId: ProjectFields_UpdateFieldOrder parameters: - name: id in: path description: The account ID required: true schema: type: integer format: int32 requestBody: description: Array of field order updates content: application/json-patch+json: schema: minItems: 1 type: array items: $ref: '#/components/schemas/FieldOrderRequest' application/json: schema: minItems: 1 type: array items: $ref: '#/components/schemas/FieldOrderRequest' text/json: schema: minItems: 1 type: array items: $ref: '#/components/schemas/FieldOrderRequest' application/*+json: schema: minItems: 1 type: array items: $ref: '#/components/schemas/FieldOrderRequest' required: true responses: '200': description: 'Success: Field order updated' content: text/plain: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' application/json: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' text/json: schema: type: array items: $ref: '#/components/schemas/ProjectFieldDefinition' '400': description: Bad Request '401': description: Unauthorized '403': description: Forbidden components: schemas: FieldDefinedValueRequest: type: object properties: valueId: type: integer format: int64 definedValue: type: string nullable: true forRemoval: type: boolean deleteExperienceFieldValues: type: boolean additionalProperties: false ProjectFieldDefinition: type: object properties: id: type: integer format: int64 example: 1394 name: type: string nullable: true example: Contact Number type: enum: - Boolean - Date - Email - PhoneNumber - Image - Text - LongText - SingleSelect - MultiSelect - Address - Currency - Phone - Integer - Number type: string example: PhoneNumber definedValues: type: array items: $ref: '#/components/schemas/FieldDefinedValue' nullable: true isRequired: type: boolean example: false isSystem: type: boolean example: false isPrivate: type: boolean example: false isFinancials: type: boolean example: false isLocked: type: boolean example: false experienceFieldId: type: string format: uuid nullable: true example: 00000000-0000-0000-0000-000000000000 displayOrder: type: integer format: int32 nullable: true example: 1 additionalProperties: false FieldDefRequest: type: object properties: id: type: integer format: int64 example: 1394 name: type: string nullable: true example: Contact Number type: enum: - Boolean - Date - Email - PhoneNumber - Image - Text - LongText - SingleSelect - MultiSelect - Address - Currency - Phone - Integer - Number type: string example: PhoneNumber definedValues: type: array items: $ref: '#/components/schemas/FieldDefinedValueRequest' nullable: true isRequired: type: boolean example: false isPrivate: type: boolean example: false isLocked: type: boolean example: false additionalProperties: false FieldDefinedValue: type: object properties: valueId: type: integer format: int64 example: 13 definedValue: type: string nullable: true example: Defined Value inUse: type: array items: type: integer format: int64 nullable: true additionalProperties: false FieldOrderRequest: required: - displayOrder - fieldId type: object properties: fieldId: maximum: 9.223372036854776e+18 minimum: 1 type: integer description: The field ID to reorder format: int64 example: 1234 displayOrder: maximum: 2147483647 minimum: 1 type: integer description: The new display order position (1-indexed) format: int32 example: 1 additionalProperties: false securitySchemes: Bearer: type: http description: Standard Authorization header using the Bearer scheme scheme: bearer bearerFormat: JWT