openapi: 3.2.0 info: title: OwnerRez API v2 Field Definitions API description: The OwnerRez API v2 is a REST/JSON API for the OwnerRez vacation-rental and short-term-rental property management platform. version: '2.0' contact: name: OwnerRez url: https://www.ownerrez.com termsOfService: https://www.ownerrez.com/legal/terms servers: - url: https://api.ownerrez.com/v2 description: OwnerRez API v2 (production) security: - basicAuth: [] - oauth2: [] tags: - name: Field Definitions description: Definitions of custom fields. paths: /fielddefinitions: get: operationId: listFieldDefinitions tags: - Field Definitions summary: List field definitions description: Returns the custom field definitions. parameters: - $ref: '#/components/parameters/Limit' - $ref: '#/components/parameters/Offset' responses: '200': $ref: '#/components/responses/FieldDefinitionList' '401': $ref: '#/components/responses/Unauthorized' post: operationId: createFieldDefinition tags: - Field Definitions summary: Create a field definition description: Creates a new custom field definition. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/FieldDefinitionInput' responses: '200': $ref: '#/components/responses/FieldDefinition' '401': $ref: '#/components/responses/Unauthorized' '422': $ref: '#/components/responses/ValidationError' /fielddefinitions/{id}: parameters: - $ref: '#/components/parameters/Id' get: operationId: getFieldDefinition tags: - Field Definitions summary: Retrieve a field definition description: Retrieves a single field definition by identifier. responses: '200': $ref: '#/components/responses/FieldDefinition' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' patch: operationId: updateFieldDefinition tags: - Field Definitions summary: Update a field definition description: Updates a custom field definition. requestBody: required: true content: application/json: schema: $ref: '#/components/schemas/FieldDefinitionInput' responses: '200': $ref: '#/components/responses/FieldDefinition' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' delete: operationId: deleteFieldDefinition tags: - Field Definitions summary: Delete a field definition description: Deletes a custom field definition. responses: '200': $ref: '#/components/responses/Deleted' '401': $ref: '#/components/responses/Unauthorized' '404': $ref: '#/components/responses/NotFound' components: responses: NotFound: description: The requested resource was not found. content: application/json: schema: $ref: '#/components/schemas/Error' ValidationError: description: The request payload failed validation. content: application/json: schema: $ref: '#/components/schemas/Error' Unauthorized: description: Missing or invalid credentials. content: application/json: schema: $ref: '#/components/schemas/Error' Deleted: description: Deletion confirmation. content: application/json: schema: $ref: '#/components/schemas/DeleteResponse' FieldDefinitionList: description: A page of field definitions. content: application/json: schema: $ref: '#/components/schemas/FieldDefinitionPage' FieldDefinition: description: A field definition. content: application/json: schema: $ref: '#/components/schemas/FieldDefinition' parameters: Limit: name: limit in: query description: Maximum number of items to return per page. schema: type: integer default: 100 Id: name: id in: path required: true description: The unique identifier of the resource. schema: type: integer Offset: name: offset in: query description: Number of items to skip for pagination. schema: type: integer default: 0 schemas: Page: type: object description: Common pagination envelope returned by list endpoints. properties: count: type: integer limit: type: integer offset: type: integer nextPageUrl: type: - string - 'null' DeleteResponse: type: object properties: id: type: integer success: type: boolean Error: type: object properties: statusCode: type: integer error: type: string messages: type: array items: type: string FieldDefinitionInput: type: object required: - name - type properties: name: type: string type: type: string entity_type: type: string options: type: array items: type: string FieldDefinition: allOf: - $ref: '#/components/schemas/FieldDefinitionInput' - type: object properties: id: type: integer FieldDefinitionPage: allOf: - $ref: '#/components/schemas/Page' - type: object properties: items: type: array items: $ref: '#/components/schemas/FieldDefinition' securitySchemes: basicAuth: type: http scheme: basic description: HTTP Basic authentication. Supply your OwnerRez API key / Personal Access Token as the username; the password is left blank. oauth2: type: oauth2 description: OAuth 2.0 Authorization Code Grant (RFC 6749 Section 4.1). Register an OAuth app in the OwnerRez Developer/API settings, send the user to the authorization URL, then exchange the returned code for an access token. flows: authorizationCode: authorizationUrl: https://app.ownerrez.com/oauth/authorize tokenUrl: https://api.ownerrez.com/oauth/access_token scopes: {}