Skip to content

Instantly share code, notes, and snippets.

@mcobzarenco
Last active July 20, 2021 17:15
Show Gist options
  • Save mcobzarenco/ff2f88808d5f1baf30b9aefad5759a1d to your computer and use it in GitHub Desktop.
Save mcobzarenco/ff2f88808d5f1baf30b9aefad5759a1d to your computer and use it in GitHub Desktop.
Re:infer OpenAPI v3.0
openapi: 3.0.0
info:
title: Reinfer
description: "\nWelcome to the Re:infer API. We strive to make the API predictable, easy to use\nand painless to integrate. If there is anything you feel we can do to improve\nit or if you encounter any bugs or unexpected behaviour, please email\n[[email protected]](mailto:[email protected]) and we will get back to you as\nsoon as possible.\n\nYou can see all available endpoints in the [API Reference](/api/summary). There\nis also an [API Tutorial](/api/tutorials/basic-tutorial).\n\n## API Endpoint\n\nAll API requests are sent to Re:infer as JSON objects to an endpoint over\nHTTPS.\n\n```txt\nhttps://reinfer.io/api/...\n```\n\n### Development and production environments\n\nIn Re:infer, development and production data and workflows are separated by\nplacing them in separate organisations, each of which is permissioned\nseparately (so that developers can have admin access in the development\norganisations while having stricter access controls in production). Both\ndevelopment and production data are accessed over the same API URL.\n\n\n## Authentication\n\nAll API requests require authentication to identify the user making the\nrequest. Authentication is provided through an access token. The developer\naccess token can be obtained from your Manage Account page.\n\nYou need to include the following HTTP header for every API call you make,\nwhere `$REINFER_TOKEN` is your Re:infer API token.\n\n```txt\nAuthorization: Bearer $REINFER_TOKEN\n```\n\n## Permissions\n\nEach API endpoint in the [API Reference](/api/summary) lists its required\npermissions. You can view the permissions you have by going to your Manage\nAccount page. The page shows the _Organisations_ you have access to and the\n_Permissions_ you have in each organisation.\n\n## Errors\n\nWe use conventional HTTP response codes to indicate success or failure of an\nAPI request. In general, codes in the `2xx` range indicate success, codes in\nthe `4xx` range indicate an error that resulted from the provided request and\ncodes in the `5xx` range indicate a problem with the Re:infer platform.\n\nRequests that error will also return a body with a `status` value of `error`\ninstead of `ok`, and an error message describing the error.\n\n```json\n{\n \"message\": \"404 Not Found\",\n \"status\": \"error\"\n}\n```\n\nNote that your request can fail due to issues in your network before it reaches\nRe:infer. In such cases the response you receive will look different from the\nRe:infer error response described above.\n\n## Performance Timing\n\nWe use the [Server-Timing HTTP header](\nhttps://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server-Timing)\nto communicate the time taken for requests to our API to be processed. We\ninclude a single metric, `total`, which you can use to measure how long our\nplatform took to process your request free from latency of the network request.\n\nAn example of the header as it will be seen in a response:\n\n```txt\nServer-Timing: total;dur=37.7\n```\n\n`Server-Timing` values are always in milliseconds, so in this case the API\nrequest with this header value took 37.7 milliseconds to process on our\nplatform.\n"
contact:
name: Reinfer Ltd.
email: [email protected]
url: https://reinfer.io
version: 25f9430bb9e39771
externalDocs:
description: Find out more at developers.reinfer.io
url: https://developers.reinfer.io
servers:
- url: https://reinfer.io/api
security:
- ApiKey: []
paths:
/v1/sources/{owner}/{source_name}:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/source_name'
put:
operationId: CreateSource
summary: Create a source
description: Create a source
tags:
- Sources
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSourceResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateSourceRequest'
security:
- ApiKey:
- sources-admin
get:
operationId: GetSource
summary: Get a source by project and name
description: Get a source by project and name
tags:
- Sources
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetSourceResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- sources-read
post:
operationId: UpdateSource
summary: Update a source
description: Update a source
tags:
- Sources
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateSourceResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateSourceRequest'
security:
- ApiKey:
- sources-admin
/v1/sources/id:{source_id}:
parameters:
- $ref: '#/components/parameters/source_id'
get:
operationId: GetSourceById
summary: Get a source by ID
description: Get a source by ID
tags:
- Sources
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetSourceByIdResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey: []
delete:
operationId: DeleteSource
summary: Delete a source
description: Delete a source
tags:
- Sources
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteSourceResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey: []
/v1/sources:
get:
operationId: GetAllSources
summary: Get all sources
description: Get all sources
tags:
- Sources
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllSourcesResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey: []
/v1/sources/{owner}:
parameters:
- $ref: '#/components/parameters/owner'
get:
operationId: GetAllSourcesInProject
summary: Get all sources in a project
description: Get all sources in a project
tags:
- Sources
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllSourcesInProjectResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- sources-read
/v1/datasets/{owner}/{dataset_name}:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
put:
operationId: CreateDataset
summary: Create a dataset
description: Create a dataset
tags:
- Datasets
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/CreateDatasetResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateDatasetRequest'
security:
- ApiKey:
- datasets-admin
get:
operationId: GetDataset
summary: Get a dataset by project and name
description: Get a dataset by project and name
tags:
- Datasets
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetDatasetResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- voc-readonly
post:
operationId: UpdateDataset
summary: Update a dataset
description: Update a dataset
tags:
- Datasets
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateDatasetResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateDatasetRequest'
security:
- ApiKey:
- datasets-admin
delete:
operationId: DeleteDataset
summary: Delete a dataset
description: Delete a dataset
tags:
- Datasets
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteDatasetResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- datasets-admin
/v1/datasets:
get:
operationId: GetAllDatasets
summary: Get all datasets
description: Get all datasets
tags:
- Datasets
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllDatasetsResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey: []
/v1/datasets/{owner}:
parameters:
- $ref: '#/components/parameters/owner'
get:
operationId: GetAllDatasetsInProject
summary: Get all datasets in a project
description: Get all datasets in a project
tags:
- Datasets
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllDatasetsInProjectResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- voc-readonly
/_private/sources/{owner}/{source_name}/comments:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/source_name'
put:
operationId: AddComments
summary: Add a batch of comments
description: Add a batch of comments. To overwrite existing comments, you need to specify the latest `context` field.
tags:
- Comments
responses:
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AddCommentsRequest'
security:
- ApiKey:
- sources-add-comments
/v1/sources/{owner}/{source_name}/sync:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/source_name'
post:
operationId: SyncComments
summary: Sync a batch of comments
description: Sync a batch of comments. Any comments with the same IDs in the source will be overwritten.
tags:
- Comments
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/SyncCommentsResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SyncCommentsRequest'
security:
- ApiKey:
- sources-add-comments
/v1/sources/{owner}/{source_name}/sync-raw-emails:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/source_name'
post:
operationId: SyncRawEmails
summary: Sync a batch of raw emails
description: Sync a batch of raw emails. Any comments with the same IDs in the source will be overwritten.
tags:
- Comments
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/SyncRawEmailsResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/SyncRawEmailsRequest'
security:
- ApiKey:
- sources-add-comments
/v1/sources/{owner}/{source_name}/comments/{comment_id}:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/source_name'
- $ref: '#/components/parameters/comment_id'
get:
operationId: GetComment
summary: Get a comment by ID
description: Get a comment by ID
tags:
- Comments
responses:
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- sources-read
/_private/datasets/{owner}/{dataset_name}/labellers:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
post:
operationId: GetAllModelsInDataset
summary: Get all the models for a dataset
description: Get all the models for a dataset
tags:
- Models
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllModelsInDatasetResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllModelsInDatasetRequest'
security:
- ApiKey:
- voc-readonly
/_private/datasets/{owner}/{dataset_name}/labellers/predict:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
post:
operationId: PredictLatest
summary: Get predictions from the latest model
description: Get predictions from the latest model
tags:
- Models
responses:
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PredictLatestRequest'
security:
- ApiKey:
- voc-readonly
/v1/datasets/{owner}/{dataset_name}/labellers/{model_version}/predict:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
- $ref: '#/components/parameters/model_version'
post:
operationId: Predict
summary: Get predictions from a specific version of a pinned model
description: Get predictions from a specific version of a pinned model
tags:
- Models
responses:
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PredictRequest'
security:
- ApiKey:
- voc-readonly
/v1/datasets/{owner}/{dataset_name}/labellers/{model_version}/predict-raw-emails:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
- $ref: '#/components/parameters/model_version'
post:
operationId: PredictRawEmails
summary: Get predictions on raw emails from a specific model version
description: Get predictions on raw emails from a specific model version
tags:
- Models
responses:
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PredictRawEmailsRequest'
security:
- ApiKey:
- voc-readonly
/v1/datasets/{owner}/{dataset_name}/triggers:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
put:
operationId: CreateTrigger
summary: Create a trigger
description: Create a trigger
tags:
- Triggers
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTriggerResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CreateTriggerRequest'
security:
- ApiKey:
- voc-readonly
- triggers-admin
get:
operationId: GetAllTriggersInDataset
summary: Get the available triggers for a dataset
description: Get the available triggers for a dataset
tags:
- Triggers
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetAllTriggersInDatasetResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- voc-readonly
- triggers-read
/v1/datasets/{owner}/{dataset_name}/triggers/{trigger_name}:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
- $ref: '#/components/parameters/trigger_name'
get:
operationId: GetTrigger
summary: Get a trigger
description: Get a trigger
tags:
- Triggers
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GetTriggerResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- voc-readonly
- triggers-read
post:
operationId: UpdateTrigger
summary: Update a trigger
description: Update a trigger
tags:
- Triggers
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateTriggerResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateTriggerRequest'
security:
- ApiKey:
- voc-readonly
- triggers-write
delete:
operationId: DeleteTrigger
summary: Delete a trigger
description: Delete a trigger
tags:
- Triggers
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteTriggerResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
security:
- ApiKey:
- voc-readonly
- triggers-admin
/v1/datasets/{owner}/{dataset_name}/triggers/{trigger_name}/fetch:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
- $ref: '#/components/parameters/trigger_name'
post:
operationId: PollTrigger
summary: Fetch new messages from a trigger
description: This operation polls a trigger and fetches any new messages
tags:
- Triggers
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/PollTriggerResponse'
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
x-ms-trigger: batch
x-ms-trigger-hint: To see it work, add a message to the dataset
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/PollTriggerRequest'
security:
- ApiKey:
- voc-readonly
- triggers-consume
/v1/datasets/{owner}/{dataset_name}/triggers/{trigger_name}/advance:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
- $ref: '#/components/parameters/trigger_name'
post:
operationId: AdvanceTrigger
summary: Advance a trigger
description: Advance a trigger
tags:
- Triggers
responses:
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AdvanceTriggerRequest'
security:
- ApiKey:
- voc-readonly
- triggers-consume
/v1/datasets/{owner}/{dataset_name}/triggers/{trigger_name}/reset:
parameters:
- $ref: '#/components/parameters/owner'
- $ref: '#/components/parameters/dataset_name'
- $ref: '#/components/parameters/trigger_name'
post:
operationId: ResetTrigger
summary: Reset a trigger
description: Reset a trigger
tags:
- Triggers
responses:
4XX:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ResetTriggerRequest'
security:
- ApiKey:
- voc-readonly
- triggers-consume
components:
securitySchemes:
ApiKey:
type: http
scheme: bearer
schemas:
ErrorResponse:
type: object
additionalProperties: false
required:
- status
- message
properties:
status:
type: string
enum:
- error
x-ms-visibility: internal
default: error
message:
type: string
CreateSourceRequest:
type: object
additionalProperties: false
required:
- source
properties:
source: &id002
type: object
additionalProperties: false
properties:
language:
type: string
enum:
- en
- de
- xlm
title:
type: string
maxLength: 128
description:
type: string
maxLength: 16384
should_translate:
type: boolean
sensitive_properties:
type: array
maxItems: 4096
items:
type: string
pattern: .*
bucket_id:
type: string
pattern: .*
CreateSourceResponse: &id001
type: object
additionalProperties: false
required:
- status
- source
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
source: &id003
type: object
additionalProperties: true
properties:
id:
type: string
pattern: .*
x-ms-summary: Source ID
description: Unique ID of the source
owner:
type: string
pattern: .*
x-ms-summary: Project
description: The project which owns the source
name:
type: string
pattern: .*
x-ms-summary: Source Name
description: The API name of the source
language:
type: string
x-ms-summary: Source Language
description: The language of the messages in the source
title:
type: string
maxLength: 128
x-ms-summary: Source Title
description: A short description of the source
description:
type: string
maxLength: 16384
x-ms-summary: Source Description
description: A longer description of the source
should_translate:
type: boolean
x-ms-summary: Automatic Translation
description: Whether messages in this source will be automatically translated
sensitive_properties:
type: array
maxItems: 4096
items:
type: string
pattern: .*
x-ms-summary: Sensitive User Properties
description: User properties that require additional permissions to view
bucket_id:
type: string
pattern: .*
x-ms-summary: Bucket ID
GetSourceResponse: *id001
GetSourceByIdResponse: *id001
UpdateSourceRequest:
type: object
additionalProperties: false
required:
- source
properties:
source: *id002
UpdateSourceResponse: *id001
DeleteSourceResponse: &id016
type: object
additionalProperties: false
required:
- status
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
GetAllSourcesResponse: &id004
type: object
additionalProperties: false
required:
- status
- sources
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
sources:
type: array
items: *id003
GetAllSourcesInProjectResponse: *id004
CreateDatasetRequest:
type: object
additionalProperties: false
required:
- dataset
properties:
dataset:
type: object
additionalProperties: false
properties:
model_family:
type: string
enum:
- english
- english-dev
- random
- german
- german-dev
- transformer-english
- transformer-xlm
has_sentiment:
type: boolean
copy_annotations_from:
type: string
pattern: .*
title: &id006
type: string
maxLength: 128
description: &id007
type: string
maxLength: 16384
source_ids: &id008
type: array
maxItems: 1024
items:
type: string
pattern: .*
entity_kinds: &id009
type: array
maxItems: 1024
items:
type: string
maxLength: 256
uniqueItems: true
entity_defs:
type: array
maxItems: 1024
items:
type: object
additionalProperties: false
properties:
name: &id010
type: string
pattern: .*
title: &id011
type: string
maxLength: 64
inherits_from: &id012
type: array
maxItems: 1
minItems: 0
items: {}
uniqueItems: true
trainable: &id013
type: boolean
rules: &id014
type: object
additionalProperties: false
properties:
suppressors:
type: array
minItems: 0
maxItems: 128
items:
type: string
maxLength: 128
required:
- name
- title
- inherits_from
- trainable
uniqueItems: true
label_defs: &id015
type: array
maxItems: 1024
items:
type: object
additionalProperties: false
properties:
name:
type: string
maxLength: 64
title:
type: string
maxLength: 128
description:
type: string
maxLength: 16384
external_id:
type: string
maxLength: 128
pretrained:
type: object
additionalProperties: false
properties:
name:
type: string
maxLength: 64
id:
type: string
pattern: .*
required:
- id
required:
- name
uniqueItems: true
CreateDatasetResponse: &id005
type: object
additionalProperties: false
required:
- status
- dataset
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
dataset: &id017
type: object
additionalProperties: true
properties:
id:
type: string
pattern: .*
x-ms-summary: Dataset ID
description: Unique ID of the dataset
owner:
type: string
pattern: .*
x-ms-summary: Project
description: The project which owns the dataset
name:
type: string
pattern: .*
x-ms-summary: API Name
description: The API name of the dataset which appears in URLs
title:
type: string
maxLength: 128
x-ms-summary: Title
description: A short description of the dataset
description:
type: string
maxLength: 16384
x-ms-summary: Description
description: A longer description of the dataset
source_ids:
type: array
items:
type: object
pattern: .*
x-ms-summary: Sources
description: IDs of the sources contained in this dataset
GetDatasetResponse: *id005
UpdateDatasetRequest:
type: object
additionalProperties: false
required:
- dataset
properties:
dataset:
type: object
additionalProperties: false
properties:
title: *id006
description: *id007
source_ids: *id008
entity_kinds: *id009
entity_defs:
type: array
maxItems: 1024
items:
type: object
additionalProperties: false
properties:
id:
type: string
pattern: .*
name: *id010
title: *id011
inherits_from: *id012
trainable: *id013
rules: *id014
required:
- name
- title
- inherits_from
- trainable
uniqueItems: true
label_defs: *id015
UpdateDatasetResponse: *id005
DeleteDatasetResponse: *id016
GetAllDatasetsResponse: &id018
type: object
additionalProperties: false
required:
- status
- datasets
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
datasets:
type: array
items: *id017
GetAllDatasetsInProjectResponse: *id018
AddCommentsRequest:
type: object
additionalProperties: false
required:
- comments
properties:
comments:
type: array
maxItems: 16384
items: &id020
type: object
additionalProperties: false
required:
- id
- timestamp
- messages
properties:
id:
type: string
pattern: .*
timestamp: &id022
type: string
pattern: .*
thread_id:
type: string
pattern: .*
user_properties: &id021
type: object
additionalProperties: false
messages: &id023
type: array
maxItems: 2048
items:
type: object
required:
- body
additionalProperties: false
properties:
from:
type: string
minLength: 1
maxLength: 512
x-ms-summary: From
description: Message sender
to:
type: array
maxItems: 2048
items:
type: string
minLength: 1
maxLength: 512
x-ms-summary: To
description: Message recipients
cc:
type: array
maxItems: 2048
items:
type: string
minLength: 1
maxLength: 512
x-ms-summary: Cc
x-ms-visibility: advanced
description: Message cc field
bcc:
type: array
maxItems: 2048
items:
type: string
minLength: 1
maxLength: 512
x-ms-summary: Bcc
x-ms-visibility: advanced
description: Message bcc field
sent_at:
type: string
pattern: .*
x-ms-summary: Sent At
description: The time when the message was sent originally
language:
type: string
minLength: 1
maxLength: 8
x-ms-summary: Langauge
description: The original language of the message
subject: &id019
type: object
required:
- text
additionalProperties: false
properties:
text:
type: string
minLength: 0
maxLength: 65536
x-ms-summary: Text
description: Text content of the message part
translated_from:
type: string
minLength: 0
maxLength: 65536
x-ms-summary: Translated From
description: The original language from which the message was translated, if applicable
body: *id019
signature: *id019
x-ms-summary: Messages
SyncCommentsRequest:
type: object
additionalProperties: false
required:
- comments
properties:
comments:
type: array
maxItems: 16384
items: *id020
SyncCommentsResponse: *id016
SyncRawEmailsRequest:
type: object
required:
- documents
additionalProperties: false
properties:
documents:
type: array
maxItems: 16384
items:
type: object
additionalProperties: false
required:
- raw_email
properties:
raw_email: &id025
type: object
additionalProperties: false
required:
- headers
- body
properties:
headers:
type: object
additionalProperties: false
properties:
raw:
type: string
maxLength: 65536
description: The raw email headers, given as a single string, with each header on its own line
x-ms-summary: Raw Headers
parsed:
type: object
additionalProperties: true
description: An object containing the headers of the email
x-ms-summary: Email Headers
body:
type: object
additionalProperties: false
properties:
plain:
type: string
maxLength: 65536
html:
type: string
maxLength: 33554432
description: An object containing the main body of the email
x-ms-summary: Email Body
description: An object containing the main body of the email
x-ms-summary: Email
comment_id:
type: string
pattern: .*
description: '
Identifies a comment uniquely. If no comment ID is provided, Re:infer will
generate the comment ID from the email''s message ID. The format is described in
the Comment Reference.'
x-ms-summary: Comment ID
user_properties: *id021
description: A batch of at most 4096 raw emails
x-ms-summary: Raw Emails
include_comments:
type: boolean
description: If set to true, the comments parsed from the emailswill be returned in the response body
x-ms-summary: Include Comments
transform_tag: &id028
type: string
pattern: .*
description: A tag identifying the email integration sending the data. You should have received this tag during integration configuration setup.
x-ms-summary: Transform Tag
override_user_properties:
type: array
maxItems: 128
items:
type: string
pattern: .*
x-ms-summary: Override User Properties
SyncRawEmailsResponse: *id016
GetAllModelsInDatasetRequest:
type: object
additionalProperties: false
properties:
older_than_version:
type: integer
minimum: 1
limit:
type: integer
minimum: 1
maximum: 100
include_deleted:
type: boolean
GetAllModelsInDatasetResponse:
type: object
additionalProperties: false
required:
- status
- dataset_status
- labellers
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
dataset_status:
type: object
additionalProperties: true
labellers:
type: array
items:
type: object
additionalProperties: true
required:
- version
- model_id
- trained_time
properties:
version:
type: integer
minimum: 0
x-ms-summary: Model Version
description: The version of the model
model_id:
type: string
x-ms-summary: Model Kind
description: The type of model
trained_time:
type: string
pattern: .*
x-ms-summary: Trained Timestamp
description: Timestamp when the model was trained
PredictLatestRequest:
type: object
required:
- documents
additionalProperties: false
properties: &id024
documents:
type: array
items:
type: object
required:
- messages
additionalProperties: false
properties:
timestamp: *id022
user_properties: *id021
messages: *id023
maxItems: 4096
threshold: &id026 {}
labels: &id027
type: array
items:
type: object
required:
- name
additionalProperties: false
properties: &id031
name:
type: array
items:
type: string
minLength: 1
maxLength: 64
pattern: .*
maxItems: 64
threshold:
type: number
minimum: 0
maximum: 1
maxItems: 4096
PredictRequest:
type: object
required:
- documents
additionalProperties: false
properties: *id024
PredictRawEmailsRequest:
type: object
required:
- documents
additionalProperties: false
properties:
documents:
type: array
maxItems: 4096
items:
type: object
additionalProperties: false
required:
- raw_email
properties:
raw_email: *id025
user_properties: *id021
threshold: *id026
labels: *id027
include_comments:
type: boolean
transform_tag: *id028
CreateTriggerRequest:
type: object
additionalProperties: false
required:
- trigger
properties:
trigger:
type: object
additionalProperties: false
required:
- name
properties: &id034
name:
type: string
pattern: .*
title:
type: string
maxLength: 128
description:
type: string
maxLength: 16384
comment_filter:
type: object
additionalProperties: false
properties:
timestamp:
type: object
additionalProperties: false
properties:
minimum:
type: string
pattern: .*
maximum:
type: string
pattern: .*
reviewed:
type: string
enum:
- only_reviewed
- only_unreviewed
sources:
type: array
uniqueItems: true
items:
type: string
pattern: .*
minItems: 1
maxItems: 128
messages:
type: object
additionalProperties: false
properties:
from: &id029
type: object
additionalProperties: false
properties:
one_of:
type: array
uniqueItems: true
items:
type: string
minLength: 1
maxLength: 65536
minItems: 1
maxItems: 128
not_one_of:
type: array
uniqueItems: true
items:
type: string
minLength: 1
maxLength: 65536
minItems: 1
maxItems: 128
domain_one_of:
type: array
uniqueItems: true
items:
type: string
minLength: 1
maxLength: 65536
minItems: 1
maxItems: 128
domain_not_one_of:
type: array
uniqueItems: true
items:
type: string
minLength: 1
maxLength: 65536
minItems: 1
maxItems: 128
recipient: *id029
to: &id030
type: object
additionalProperties: false
properties:
one_of:
type: array
uniqueItems: true
items:
type: string
minLength: 1
maxLength: 65536
minItems: 1
maxItems: 128
not_one_of:
type: array
uniqueItems: true
items:
type: string
minLength: 1
maxLength: 65536
minItems: 1
maxItems: 128
cc: *id030
bcc: *id030
user_properties:
type: object
additionalProperties: false
trigger_exceptions:
type: object
additionalProperties: false
annotations:
type: object
additionalProperties: false
properties:
labels: *id030
model:
type: object
additionalProperties: false
required:
- version
properties:
version:
type: integer
minimum: 0
label_thresholds:
type: array
items:
type: object
required:
- name
- threshold
additionalProperties: false
properties: *id031
minItems: 1
maxItems: 4096
CreateTriggerResponse: &id032
type: object
additionalProperties: false
required:
- status
- trigger
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
trigger: &id033
type: object
additionalProperties: true
properties:
id:
type: string
pattern: .*
owner:
type: string
pattern: .*
name:
type: string
pattern: .*
title:
type: string
maxLength: 128
description:
type: string
maxLength: 16384
GetTriggerResponse: *id032
GetAllTriggersInDatasetResponse:
type: object
additionalProperties: false
required:
- status
- triggers
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
triggers:
type: array
items: *id033
UpdateTriggerRequest:
type: object
additionalProperties: false
required:
- trigger
properties:
trigger:
type: object
additionalProperties: false
properties: *id034
UpdateTriggerResponse: *id032
DeleteTriggerResponse: *id016
PollTriggerRequest:
type: object
additionalProperties: false
required:
- size
properties:
size:
type: integer
minimum: 1
maximum: 1024
default: 16
description: The number of comments to fetch from this trigger
x-ms-summary: Batch Size
x-ms-visibility: advanced
max_filtered:
type: integer
minimum: 1
maximum: 1024
description: How many comments to skip if if they don't match the trigger's comment filter
x-ms-summary: Max Filtered
x-ms-visibility: advanced
PollTriggerResponse:
type: object
additionalProperties: false
required:
- status
- filtered
- sequence_id
- results
properties:
status:
type: string
enum:
- ok
x-ms-visibility: internal
default: ok
filtered:
type: number
sequence_id:
type: string
pattern: .*
x-ms-summary: Sequence ID
description: Sequence ID used to advance the trigger once comments are processed
results:
type: array
items:
type: object
additionalProperties: true
properties:
comment:
type: object
additionalProperties: true
properties:
id:
type: string
pattern: .*
x-ms-summary: Comment ID
description: ID of the comment unique within a source
source_id:
type: string
pattern: .*
x-ms-summary: Source ID
description: ID of the source containing the comment
timestamp:
type: string
pattern: .*
x-ms-summary: Comment Timestamp
description: User supplied comment timestamp
labels:
type: array
items:
type: object
additionalProperties: true
x-ms-summary: Labels
entities:
type: array
items:
type: object
additionalProperties: true
x-ms-summary: Entities
sequence_id:
type: string
pattern: .*
x-ms-summary: Comment Sequence ID
description: Sequence ID for this comment
AdvanceTriggerRequest:
type: object
additionalProperties: false
required:
- sequence_id
properties:
sequence_id:
type: string
pattern: .*
x-ms-summary: Sequence ID
ResetTriggerRequest:
type: object
additionalProperties: false
required:
- to_comment_created_at
properties:
to_comment_created_at:
type: string
pattern: .*
parameters:
owner:
in: path
name: owner
description: The name of the project which contains the resource
x-ms-summary: Project Name
required: true
schema:
type: string
pattern: ^[A-Za-z0-9-_.]{1,1024}$
x-ms-dynamic-values:
operationId: GetAllSources
value-collection: sources
value-path: owner
value-title: owner
parameters: {}
source_id:
in: path
name: source_id
description: Source ID
x-ms-summary: Source ID
required: true
schema:
type: string
pattern: ^[0-9a-f]{16}$
x-ms-dynamic-values:
operationId: GetAllSources
value-collection: sources
value-path: id
value-title: name
parameters: {}
source_name:
in: path
name: source_name
description: email-source-123
x-ms-summary: Source Name
required: true
schema:
type: string
pattern: ^[A-Za-z0-9-_]{1,256}$
x-ms-dynamic-values:
operationId: GetAllSourcesInProject
value-collection: sources
value-path: name
value-title: name
parameters:
owner:
parameter: owner
comment_id:
in: path
name: comment_id
description: Comment ID
x-ms-summary: Comment ID
required: true
schema:
type: string
pattern: ^[\w\x21-\x2e\x3a-\x40\x5b-\x60\x7b-\x7e]{1,1024}$
dataset_name:
in: path
name: dataset_name
description: The name of the dataset
x-ms-summary: Dataset Name
required: true
schema:
type: string
pattern: ^[A-Za-z0-9-_]{1,256}$
x-ms-dynamic-values:
operationId: GetAllDatasetsInProject
value-collection: datasets
value-path: name
value-title: name
parameters:
owner:
parameter: owner
trigger_name:
in: path
name: trigger_name
description: Trigger name
x-ms-summary: Trigger Name
required: true
schema:
type: string
pattern: ^[A-Za-z0-9-_]{1,256}$
x-ms-dynamic-values:
operationId: GetAllTriggersInDataset
value-collection: triggers
value-path: name
value-title: name
parameters:
owner:
parameter: owner
dataset_name:
parameter: dataset_name
model_version:
in: path
name: model_version
description: The version of a pinned model to use
x-ms-summary: Model Version
required: true
schema:
type: integer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment