openapi: 3.0.3 info: title: Baserow API spec Admin Field rules API version: 2.2.2 description: 'For more information about our REST API, please visit [this page](https://baserow.io/docs/apis%2Frest-api). For more information about our deprecation policy, please visit [this page](https://baserow.io/docs/apis%2Fdeprecations).' contact: url: https://baserow.io/contact license: name: MIT url: https://github.com/baserow/baserow/blob/develop/LICENSE tags: - name: Field rules paths: /api/database/field-rules/{table_id}/: get: operationId: get_field_rules description: Get a list of field rules for the table parameters: - in: path name: table_id schema: type: integer description: The ID of the table to get field rules. required: true tags: - Field rules security: - UserSource JWT: [] - JWT: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Field_RulesResponseFieldRule' description: '' '400': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_USER_NOT_IN_GROUP detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' '404': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_TABLE_DOES_NOT_EXIST detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' post: operationId: create_field_rule description: Create a field rule for a table parameters: - in: path name: table_id schema: type: integer description: The ID of the table to set a field rule. required: true tags: - Field rules requestBody: content: application/json: schema: $ref: '#/components/schemas/Field_RulesRequestFieldRule' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Field_RulesRequestFieldRule' multipart/form-data: schema: $ref: '#/components/schemas/Field_RulesRequestFieldRule' security: - UserSource JWT: [] - JWT: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Field_RulesResponseFieldRule' description: '' '400': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_USER_NOT_IN_GROUP - ERROR_REQUEST_BODY_VALIDATION - ERROR_RULE_TYPE_DOES_NOT_EXIST detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' '404': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_TABLE_DOES_NOT_EXIST detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' '409': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_RULE_ALREADY_EXISTS detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' /api/database/field-rules/{table_id}/invalid-rows/: get: operationId: get_invalid_rows description: Get a list of invalid rows parameters: - in: path name: table_id schema: type: integer description: The ID of the table to get a list of invalid row ids. required: true tags: - Field rules security: - UserSource JWT: [] - JWT: [] responses: '200': content: application/json: schema: $ref: '#/components/schemas/PaginationSerializerInvalidRow' description: '' '400': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_USER_NOT_IN_GROUP detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' '404': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_TABLE_DOES_NOT_EXIST detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' /api/database/field-rules/{table_id}/rule/{rule_id}/: put: operationId: update_field_rule description: Update a specific field rule. parameters: - in: path name: rule_id schema: type: integer description: The ID of the rule to update. required: true - in: path name: table_id schema: type: integer description: The ID of the table. required: true tags: - Field rules requestBody: content: application/json: schema: $ref: '#/components/schemas/Field_RulesRequestUpdateFieldRule' application/x-www-form-urlencoded: schema: $ref: '#/components/schemas/Field_RulesRequestUpdateFieldRule' multipart/form-data: schema: $ref: '#/components/schemas/Field_RulesRequestUpdateFieldRule' security: - UserSource JWT: [] - JWT: [] responses: '200': content: application/json: schema: type: array items: $ref: '#/components/schemas/Field_RulesResponseFieldRule' description: '' '400': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_USER_NOT_IN_GROUP - ERROR_REQUEST_BODY_VALIDATION detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' '404': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_RULE_DOES_NOT_EXIST - ERROR_TABLE_DOES_NOT_EXIST detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' delete: operationId: delete_field_rule description: Delete a field rule. parameters: - in: path name: rule_id schema: type: integer description: The ID of the rule to delete. required: true - in: path name: table_id schema: type: integer description: The ID of the table. required: true tags: - Field rules security: - UserSource JWT: [] - JWT: [] responses: '204': description: No response body '400': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_USER_NOT_IN_GROUP detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' '404': content: application/json: schema: type: object properties: error: type: string description: Machine readable error indicating what went wrong. enum: - ERROR_RULE_DOES_NOT_EXIST detail: oneOf: - type: string format: string description: Human readable details about what went wrong. - type: object format: object description: Machine readable object about what went wrong. description: '' components: schemas: Type908Enum: enum: - date_dependency type: string description: '* `date_dependency` - date_dependency' PaginationSerializerInvalidRow: type: object properties: count: type: integer description: The total amount of results. next: type: string format: uri nullable: true description: URL to the next page. previous: type: string format: uri nullable: true description: URL to the previous page. results: type: array items: $ref: '#/components/schemas/InvalidRow' required: - count - next - previous - results Field_RulesRequestFieldRule: oneOf: - $ref: '#/components/schemas/DateDependencyRequestFieldRule' discriminator: propertyName: type mapping: date_dependency: '#/components/schemas/DateDependencyRequestFieldRule' Field_RulesResponseFieldRule: oneOf: - $ref: '#/components/schemas/DateDependencyResponseFieldRule' discriminator: propertyName: type mapping: date_dependency: '#/components/schemas/DateDependencyResponseFieldRule' DateDependencyRequestUpdateFieldRule: type: object description: Serializes inbound date dependency configuration. Requires `table` in the context. properties: is_active: type: boolean description: Whether the date dependency is active or not. If set to false, all other values in the payload will be ignored. type: allOf: - $ref: '#/components/schemas/Type908Enum' description: 'The type of the field rule that must be created. * `date_dependency` - date_dependency' start_date_field_id: type: integer description: Start date field id end_date_field_id: type: integer description: End date field id duration_field_id: type: integer description: Duration field id dependency_linkrow_field_id: type: integer nullable: true description: Linkrow field id required: - is_active - type DateDependencyRequestFieldRule: type: object description: Serializes inbound date dependency configuration. Requires `table` in the context. properties: is_active: type: boolean description: Whether the date dependency is active or not. If set to false, all other values in the payload will be ignored. type: allOf: - $ref: '#/components/schemas/Type908Enum' description: 'The type of the field rule that must be created. * `date_dependency` - date_dependency' start_date_field_id: type: integer description: Start date field id end_date_field_id: type: integer description: End date field id duration_field_id: type: integer description: Duration field id dependency_linkrow_field_id: type: integer nullable: true description: Linkrow field id required: - is_active - type DateDependencyResponseFieldRule: type: object description: Serializes inbound date dependency configuration. Requires `table` in the context. properties: id: type: integer readOnly: true table_id: type: integer description: The table that this field rule applies to. readOnly: true is_valid: type: boolean readOnly: true description: Tells if the rule is valid in the context of a table. This field is read-only. error_text: type: string readOnly: true nullable: true description: Stores information about validation error, if it's present. This field is read-only. is_active: type: boolean description: Whether the date dependency is active or not. If set to false, all other values in the payload will be ignored. type: allOf: - $ref: '#/components/schemas/Type908Enum' description: 'The type of the field rule that must be created. * `date_dependency` - date_dependency' start_date_field_id: type: integer description: Start date field id end_date_field_id: type: integer description: End date field id duration_field_id: type: integer description: Duration field id dependency_linkrow_field_id: type: integer nullable: true description: Linkrow field id required: - error_text - id - is_active - is_valid - table_id - type InvalidRow: type: object properties: id: type: integer readOnly: true required: - id Field_RulesRequestUpdateFieldRule: oneOf: - $ref: '#/components/schemas/DateDependencyRequestUpdateFieldRule' discriminator: propertyName: type mapping: date_dependency: '#/components/schemas/DateDependencyRequestUpdateFieldRule' securitySchemes: Database token: type: http scheme: bearer bearerFormat: Token your_token JWT: type: http scheme: bearer bearerFormat: JWT your_token UserSource JWT: type: http scheme: bearer bearerFormat: JWT your_token