Create backfill
Creating the backfill enables adding or replacing past events, even those that are older than the ingestion grace period. Performing a backfill in Orb involves 3 steps:
- Create the backfill, specifying its parameters.
- Ingest usage events, referencing the backfill (query parameter
backfill_id
). - Close the backfill, propagating the update in past usage throughout Orb.
Changes from a backfill are not reflected until the backfill is closed, so you won’t need to worry about your customers seeing partially updated usage data. Backfills are also reversible, so you’ll be able to revert a backfill if you’ve made a mistake.
This endpoint will return a
backfill object, which contains an id
. That id
can then be used as the backfill_id
query parameter to the event
ingestion endpoint to associate ingested events with this backfill. The effects (e.g. updated usage graphs) of this
backfill will not take place until the backfill is closed.
If the replace_existing_events
is true
, existing
events in the backfill's timeframe will be replaced with the newly ingested events associated with the backfill. If
false
, newly ingested events will be added to the existing events.
If a customer_id
or external_customer_id
is specified, the backfill will only affect events for that customer.
If neither is specified, the backfill will affect all customers.
When replace_existing_events
is true
, the field filter
can be optionally added which enables filtering using
computed properties. The expressiveness of computed properties
allows you to deprecate existing events based on both a period of time and specific property values.
Request Body required
Default value: true
If true, replaces all existing events in the timeframe with the newly ingested events. If false, adds the newly ingested events to the existing events.
The (inclusive) start of the usage timeframe affected by this backfill.
The (exclusive) end of the usage timeframe affected by this backfill.
The time at which no more events will be accepted for this backfill. The backfill will automatically begin reflecting throughout Orb at the close time. If not specified, it will default to 1 day after the creation of the backfill.
The Orb-generated ID of the customer to which this backfill is scoped. Omitting this field will scope the backfill to all customers.
The external customer ID of the customer to which this backfill is scoped. Omitting this field will scope the backfill to all customers.
A boolean computed property used to filter the set of events to deprecate
- 200
- 400
- 401
- 404
- 409
- 413
- 429
- 500
OK
Response Headers
Schema
Possible values: [pending
, reflected
, pending_revert
, reverted
]
The status of the backfill.
The number of events ingested in this backfill.
If in the future, the time at which the backfill will automatically close. If in the past, the time at which the backfill was closed.
The time at which this backfill was reverted.
The Orb-generated ID of the customer to which this backfill is scoped. If null
, this backfill is scoped to all customers.
A boolean computed property used to filter the set of events to deprecate
{
"id": "string",
"status": "pending",
"created_at": "2024-12-20T17:17:31.937Z",
"timeframe_start": "2024-12-20T17:17:31.937Z",
"timeframe_end": "2024-12-20T17:17:31.937Z",
"events_ingested": 0,
"close_time": "2024-12-20T17:17:31.937Z",
"reverted_at": "2024-12-20T17:17:31.937Z",
"customer_id": "string",
"deprecation_filter": "my_numeric_property > 100 AND my_other_property = 'bar'"
}
Bad Request
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#400-constraint-violation
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#400-duplicate-resource-creation
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#400-request-validation-errors
]
Possible values: [400
]
{}
Unauthorized
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#401-authentication-error
]
Possible values: [401
]
{
"type": "https://docs.withorb.com/reference/error-responses#401-authentication-error",
"status": 401,
"detail": "string",
"title": "string"
}
Not Found
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#404-feature-not-available
]
Possible values: [400
]
Possible values: [https://docs.withorb.com/reference/error-responses#404-resource-not-found
]
Possible values: [404
]
Possible values: [https://docs.withorb.com/reference/error-responses#404-url-not-found
]
Possible values: [404
]
{}
Conflict
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#409-resource-conflict
]
Possible values: [409
]
{
"type": "https://docs.withorb.com/reference/error-responses#409-resource-conflict",
"status": 409,
"detail": "string",
"title": "string"
}
Request Entity Too Large
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#413-request-too-large
]
Possible values: [413
]
Possible values: [https://docs.withorb.com/reference/error-responses#413-resource-too-large
]
Possible values: [413
]
Possible values: [https://docs.withorb.com/reference/error-responses#413-too-many-results
]
Possible values: [413
]
{}
Too Many Requests
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#429-too-many-requests
]
Possible values: [429
]
{
"type": "https://docs.withorb.com/reference/error-responses#429-too-many-requests",
"status": 429,
"detail": "string",
"title": "string"
}
Internal Server Error
Response Headers
Schema
Possible values: [https://docs.withorb.com/reference/error-responses#500-internal-server-error
]
{
"type": "https://docs.withorb.com/reference/error-responses#500-internal-server-error",
"status": 0,
"detail": "string",
"title": "string"
}