# Events

## Publish events to Fiddler Platform

> Publish events to Fiddler Platform

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"tags":[{"name":"ingestion-v3"}],"servers":[{"url":"https://{fiddler-instance}","description":"Your Fiddler instance URL","variables":{"fiddler-instance":{"default":"app.fiddler.ai","description":"Your Fiddler instance domain (e.g., app.fiddler.ai, your-company.fiddler.ai, or your on-prem instance URL)"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"PublishEventsRequest":{"type":"object","required":["model_id","env_type","source"],"properties":{"model_id":{"type":"string","format":"uuid"},"env_type":{"type":"string","enum":["PRODUCTION","PRE_PRODUCTION"]},"env_name":{"type":"string","nullable":true},"source":{"anyOf":[{"$ref":"#/components/schemas/EventsSource"},{"$ref":"#/components/schemas/FileSource"}]}}},"EventsSource":{"type":"object","properties":{"type":{"type":"string","enum":["EVENTS"]},"events":{"type":"array","maxLength":1000,"items":{"oneOf":[{"type":"object"}]}}}},"FileSource":{"type":"object","properties":{"type":{"type":"string","enum":["FILE"]},"file_id":{"type":"string","format":"uuid"}}},"ApiResponse":{"type":"object","description":"Response object for standard API responses.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version.\n"},"kind":{"type":"string","default":"NORMAL","enum":["NORMAL"],"description":"Type of response, indicating a normal response.\n"}}},"PublishEventsResponse":{"anyOf":[{"$ref":"#/components/schemas/EventsResponse"},{"$ref":"#/components/schemas/InjestionFileResponse"}]},"EventsResponse":{"type":"object","properties":{"source_type":{"type":"string","enum":["EVENTS"]},"event_ids":{"type":"array","items":{"$ref":"#/components/schemas/EventId"}}}},"EventId":{"type":"string","format":"uuid"},"InjestionFileResponse":{"type":"object","properties":{"source_type":{"type":"string","enum":["FILE"]},"job":{"$ref":"#/components/schemas/JobCompact"}}},"JobCompact":{"type":"object","title":"JobCompact","description":"Compact version of a job which can be included in the response of relevant APIs.\n","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the job.\n"},"name":{"type":"string","description":"Name of the job.\n"}}},"ErrorResponse":{"type":"object","description":"Response object for errors returned by the API.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version of the response.\n"},"kind":{"type":"string","default":"ERROR","enum":["ERROR"],"description":"Type of response, usually indicating an error.\n"},"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","description":"Represents the code for this error, typically an HTTP response code.\n","default":400,"enum":[400,403,404,500]},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there are multiple errors, it will be the message for the first error.\n"},"errors":{"type":"array","description":"Container for additional information regarding the error, especially for multiple errors.\n","items":{"type":"object","properties":{"reason":{"type":"string","description":"Unique identifier for this error, different from the error code.\n"},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there is only one error, this field will match error.message.\n"},"help":{"type":"string","description":"Link to support or documentation providing more information on the error.\n"}}}}}}}}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v3/events":{"post":{"tags":["ingestion-v3"],"summary":"Publish events to Fiddler Platform","description":"Publish events to Fiddler Platform","operationId":"publishEvents","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishEventsRequest"}}}},"responses":{"200":{"description":"Events uploaded","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PublishEventsResponse"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"404":{"$ref":"#/components/responses/404"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Publish update events to Fiddler Platform

> Publish update events to Fiddler Platform

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"tags":[{"name":"ingestion-v3"}],"servers":[{"url":"https://{fiddler-instance}","description":"Your Fiddler instance URL","variables":{"fiddler-instance":{"default":"app.fiddler.ai","description":"Your Fiddler instance domain (e.g., app.fiddler.ai, your-company.fiddler.ai, or your on-prem instance URL)"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"PublishEventsRequest":{"type":"object","required":["model_id","env_type","source"],"properties":{"model_id":{"type":"string","format":"uuid"},"env_type":{"type":"string","enum":["PRODUCTION","PRE_PRODUCTION"]},"env_name":{"type":"string","nullable":true},"source":{"anyOf":[{"$ref":"#/components/schemas/EventsSource"},{"$ref":"#/components/schemas/FileSource"}]}}},"EventsSource":{"type":"object","properties":{"type":{"type":"string","enum":["EVENTS"]},"events":{"type":"array","maxLength":1000,"items":{"oneOf":[{"type":"object"}]}}}},"FileSource":{"type":"object","properties":{"type":{"type":"string","enum":["FILE"]},"file_id":{"type":"string","format":"uuid"}}},"ApiResponse":{"type":"object","description":"Response object for standard API responses.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version.\n"},"kind":{"type":"string","default":"NORMAL","enum":["NORMAL"],"description":"Type of response, indicating a normal response.\n"}}},"PublishEventsResponse":{"anyOf":[{"$ref":"#/components/schemas/EventsResponse"},{"$ref":"#/components/schemas/InjestionFileResponse"}]},"EventsResponse":{"type":"object","properties":{"source_type":{"type":"string","enum":["EVENTS"]},"event_ids":{"type":"array","items":{"$ref":"#/components/schemas/EventId"}}}},"EventId":{"type":"string","format":"uuid"},"InjestionFileResponse":{"type":"object","properties":{"source_type":{"type":"string","enum":["FILE"]},"job":{"$ref":"#/components/schemas/JobCompact"}}},"JobCompact":{"type":"object","title":"JobCompact","description":"Compact version of a job which can be included in the response of relevant APIs.\n","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the job.\n"},"name":{"type":"string","description":"Name of the job.\n"}}},"ErrorResponse":{"type":"object","description":"Response object for errors returned by the API.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version of the response.\n"},"kind":{"type":"string","default":"ERROR","enum":["ERROR"],"description":"Type of response, usually indicating an error.\n"},"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","description":"Represents the code for this error, typically an HTTP response code.\n","default":400,"enum":[400,403,404,500]},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there are multiple errors, it will be the message for the first error.\n"},"errors":{"type":"array","description":"Container for additional information regarding the error, especially for multiple errors.\n","items":{"type":"object","properties":{"reason":{"type":"string","description":"Unique identifier for this error, different from the error code.\n"},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there is only one error, this field will match error.message.\n"},"help":{"type":"string","description":"Link to support or documentation providing more information on the error.\n"}}}}}}}}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v3/events":{"patch":{"tags":["ingestion-v3"],"summary":"Publish update events to Fiddler Platform","description":"Publish update events to Fiddler Platform","operationId":"publishEventsUpdate","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishEventsRequest"}}}},"responses":{"200":{"description":"Events uploaded","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/PublishEventsResponse"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"404":{"$ref":"#/components/responses/404"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## Delete events in Fiddler Platform

> Delete events in Fiddler Platform

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"tags":[{"name":"ingestion-v3"}],"servers":[{"url":"https://{fiddler-instance}","description":"Your Fiddler instance URL","variables":{"fiddler-instance":{"default":"app.fiddler.ai","description":"Your Fiddler instance domain (e.g., app.fiddler.ai, your-company.fiddler.ai, or your on-prem instance URL)"}}}],"security":[{"BearerAuth":[]}],"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"}},"schemas":{"DeleteEventsRequest":{"type":"object","required":["model_id"],"properties":{"model_id":{"type":"string","format":"uuid"},"time_range":{"type":"object","properties":{"start_time":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"end_time":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]}},"nullable":true},"event_ids":{"type":"array","items":{"type":"string"},"nullable":true},"update_metrics":{"type":"boolean"}}},"ApiResponse":{"type":"object","description":"Response object for standard API responses.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version.\n"},"kind":{"type":"string","default":"NORMAL","enum":["NORMAL"],"description":"Type of response, indicating a normal response.\n"}}},"DeleteEventsResponse":{"type":"object","properties":{"job":{"$ref":"#/components/schemas/JobCompact"}}},"JobCompact":{"type":"object","title":"JobCompact","description":"Compact version of a job which can be included in the response of relevant APIs.\n","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the job.\n"},"name":{"type":"string","description":"Name of the job.\n"}}},"ErrorResponse":{"type":"object","description":"Response object for errors returned by the API.\n","properties":{"api_version":{"type":"string","default":"3.0","enum":["2.0","3.0"],"description":"API version of the response.\n"},"kind":{"type":"string","default":"ERROR","enum":["ERROR"],"description":"Type of response, usually indicating an error.\n"},"error":{"type":"object","properties":{"code":{"type":"integer","format":"int32","description":"Represents the code for this error, typically an HTTP response code.\n","default":400,"enum":[400,403,404,500]},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there are multiple errors, it will be the message for the first error.\n"},"errors":{"type":"array","description":"Container for additional information regarding the error, especially for multiple errors.\n","items":{"type":"object","properties":{"reason":{"type":"string","description":"Unique identifier for this error, different from the error code.\n"},"message":{"type":"string","description":"A human-readable message providing more details about the error. If there is only one error, this field will match error.message.\n"},"help":{"type":"string","description":"Link to support or documentation providing more information on the error.\n"}}}}}}}}},"responses":{"400":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"paths":{"/v3/events":{"delete":{"tags":["ingestion-v3"],"summary":"Delete events in Fiddler Platform","description":"Delete events in Fiddler Platform","operationId":"deleteEventsV3","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteEventsRequest"}}}},"responses":{"202":{"description":"Events Deletion request received","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/ApiResponse"},{"type":"object","properties":{"data":{"$ref":"#/components/schemas/DeleteEventsResponse"}}}]}}}},"400":{"$ref":"#/components/responses/400"},"404":{"$ref":"#/components/responses/404"},"500":{"$ref":"#/components/responses/500"}}}}}}
```

## The EventId object

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"components":{"schemas":{"EventId":{"type":"string","format":"uuid"}}}}
```

## The EventsSource object

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"components":{"schemas":{"EventsSource":{"type":"object","properties":{"type":{"type":"string","enum":["EVENTS"]},"events":{"type":"array","maxLength":1000,"items":{"oneOf":[{"type":"object"}]}}}}}}}
```

## The EventsResponse object

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"components":{"schemas":{"EventsResponse":{"type":"object","properties":{"source_type":{"type":"string","enum":["EVENTS"]},"event_ids":{"type":"array","items":{"$ref":"#/components/schemas/EventId"}}}},"EventId":{"type":"string","format":"uuid"}}}}
```

## The DeleteEventsRequest object

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"components":{"schemas":{"DeleteEventsRequest":{"type":"object","required":["model_id"],"properties":{"model_id":{"type":"string","format":"uuid"},"time_range":{"type":"object","properties":{"start_time":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]},"end_time":{"oneOf":[{"type":"string"},{"type":"integer"},{"type":"number"}]}},"nullable":true},"event_ids":{"type":"array","items":{"type":"string"},"nullable":true},"update_metrics":{"type":"boolean"}}}}}}
```

## The DeleteEventsResponse object

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"components":{"schemas":{"DeleteEventsResponse":{"type":"object","properties":{"job":{"$ref":"#/components/schemas/JobCompact"}}},"JobCompact":{"type":"object","title":"JobCompact","description":"Compact version of a job which can be included in the response of relevant APIs.\n","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the job.\n"},"name":{"type":"string","description":"Name of the job.\n"}}}}}}
```

## The PublishEventsRequest object

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"components":{"schemas":{"PublishEventsRequest":{"type":"object","required":["model_id","env_type","source"],"properties":{"model_id":{"type":"string","format":"uuid"},"env_type":{"type":"string","enum":["PRODUCTION","PRE_PRODUCTION"]},"env_name":{"type":"string","nullable":true},"source":{"anyOf":[{"$ref":"#/components/schemas/EventsSource"},{"$ref":"#/components/schemas/FileSource"}]}}},"EventsSource":{"type":"object","properties":{"type":{"type":"string","enum":["EVENTS"]},"events":{"type":"array","maxLength":1000,"items":{"oneOf":[{"type":"object"}]}}}},"FileSource":{"type":"object","properties":{"type":{"type":"string","enum":["FILE"]},"file_id":{"type":"string","format":"uuid"}}}}}}
```

## The PublishEventsResponse object

```json
{"openapi":"3.0.3","info":{"title":"Fiddler API - 2.0","version":"2.0"},"components":{"schemas":{"PublishEventsResponse":{"anyOf":[{"$ref":"#/components/schemas/EventsResponse"},{"$ref":"#/components/schemas/InjestionFileResponse"}]},"EventsResponse":{"type":"object","properties":{"source_type":{"type":"string","enum":["EVENTS"]},"event_ids":{"type":"array","items":{"$ref":"#/components/schemas/EventId"}}}},"EventId":{"type":"string","format":"uuid"},"InjestionFileResponse":{"type":"object","properties":{"source_type":{"type":"string","enum":["FILE"]},"job":{"$ref":"#/components/schemas/JobCompact"}}},"JobCompact":{"type":"object","title":"JobCompact","description":"Compact version of a job which can be included in the response of relevant APIs.\n","required":["id","name"],"properties":{"id":{"type":"string","format":"uuid","description":"Unique identifier of the job.\n"},"name":{"type":"string","description":"Name of the job.\n"}}}}}}
```
