Skip to content
Ingest rules

The Ingest Rule object

An ingest rule is a standing instruction on one storage origin: when an object matching its filters lands in the bucket, create this job for it. Your storage provider posts its object-created event to the rule’s endpoint_url, and no server of yours is in the path. Ingest Rules explains the endpoint, the event shapes each provider sends, and how deliveries authenticate; this page lists the calls.

Base path: transcodely.v1.IngestRuleService Requires: an app-scoped API key (ak_), or a dashboard session with the X-Organization-ID header. With a session, creating, updating and deleting rules and replaying events needs the member role or higher; the viewer role can only read.

Important: The rule’s inbound secret (ings_…) is returned in full only by Create and by an Update that rotates it. It cannot be read again.


Attributes

AttributeTypeDescription
idstringUnique identifier. Prefixed with ing_.
app_idstringThe app that owns the rule.
origin_idstringThe origin the objects land in. It must have read permission.
namestringHuman-readable name.
enabledbooleanWhether events turn into jobs. A disabled rule still answers 202 and records each event as skipped with reason rule_disabled, so the provider’s subscription does not start failing.
filtersobjectWhich objects the rule acts on. See Filters. An empty set matches everything in the bucket.
actionobjectThe job to create. See Action.
endpoint_urlstringWhere the event sender posts. Read-only.
secret_prefixstringThe first 8 characters of the inbound secret, for example ings_a1b.
secret_hintstringThe last 4 characters of the inbound secret.
secret_rotated_atstringWhen the secret was last rotated. null if never.
previous_secret_expires_atstringUntil when the previous secret is still accepted after a rotation. null when no rotation is in flight.
events_receivedstringHow many events the rule has accepted, all time.
jobs_createdstringHow many jobs the rule has created, all time.
last_event_atstringWhen the last event arrived. null before the first.
created_atstringISO 8601 timestamp.
updated_atstringISO 8601 timestamp.
{
  "id": "ing_a1b2c3d4e5f6",
  "app_id": "app_k1l2m3n4o5",
  "origin_id": "ori_a1b2c3d4e5f6",
  "name": "Watch uploads/",
  "enabled": true,
  "filters": {
    "prefix": "uploads/",
    "suffixes": [".mp4", ".mov"],
    "content_types": [],
    "min_bytes": "1024",
    "max_bytes": "0"
  },
  "action": {
    "outputs": [{ "preset": "pst_x9y8z7w6v5" }],
    "managed": true,
    "thumbnails": [],
    "priority": "standard",
    "metadata": {}
  },
  "endpoint_url": "https://api.transcodely.com/ingest/ing_a1b2c3d4e5f6",
  "secret_prefix": "ings_a1b",
  "secret_hint": "z9y8",
  "secret_rotated_at": null,
  "previous_secret_expires_at": null,
  "events_received": "42",
  "jobs_created": "40",
  "last_event_at": "2026-12-03T17:42:10Z",
  "created_at": "2026-11-20T09:00:00Z",
  "updated_at": "2026-11-20T09:00:00Z"
}

Filters

Every filter that is set must pass. An object that fails one is recorded as skipped, never as an error.

FieldTypeDescription
prefixstringObject key prefix, for example uploads/, matched against the URL-decoded key. Up to 1024 characters.
suffixesarrayCase-insensitive key endings, for example [".mp4", ".mov"]. Up to 20. Empty accepts every extension.
content_typesarrayExact content types, for example ["video/mp4"]. Up to 20. Empty accepts every type, including an event that reports none.
min_bytesintegerSmallest object to act on, in bytes. 0 means no lower bound. Useful against the zero-byte placeholder some clients write first.
max_bytesintegerLargest object to act on, in bytes. 0 means no upper bound. Otherwise it must be at least min_bytes.

Action

The part of a job request that can be decided ahead of time. The input comes from the event: the rule’s origin and the object’s key.

FieldTypeDescription
outputsarrayOutput specifications, as on a job. At least one, at most 10. Presets by id or slug.
managedbooleanDeliver to Transcodely hosting and create a hosted video. Set this or output_origin_id, not both.
output_origin_idstringYour own origin to write to, with write permission.
output_path_templatestringAs on a job, plus {input_key}, {input_name} (the key’s last segment without its extension) and {input_dir}. Must not start with / or contain ...
thumbnailsarrayThumbnail specifications, as on a job. At most 5.
prioritystringOne of: economy, standard, premium.
metadataobjectCopied onto every job. The rule adds ingest_rule_id and ingest_object_key itself. Keys starting with transcodely_ are refused.

The StorageEvent object

One delivery from your storage provider, and what came of it.

AttributeTypeDescription
idstringPrefixed with sev_.
rule_idstringThe rule that received it.
app_idstringThe app that owns the rule.
bucketstringThe bucket, as the provider reported it.
object_keystringThe object key, URL-decoded.
etagstringThe object’s version identity, used for deduplication. Empty when the provider sent none.
size_bytesstringObject size, when the event reported one.
content_typestringContent type, when the event reported one.
sourcestringOne of: s3_sns, gcs_pubsub, supabase, generic. Detected from the payload.
statusstringOne of: received, matched, skipped, created, failed.
reasonstringFor skipped and failed: filter_prefix, filter_suffix, filter_content_type, filter_size, bucket_mismatch, rule_disabled, duplicate, reserved_object (the object Transcodely writes under the origin’s base path to validate it, .transcodely-validation or an older .transcodely-validation-<timestamp>, never ingested whatever the filters), or the API error code that refused the job, such as limit_exceeded.
job_idstringThe job created from the event, if one was.
received_atstringWhen the event was accepted.
processed_atstringWhen it reached a final status. null until then.

An object is identified by rule, bucket, key and etag, and produces one job however often it is delivered. Re-sending an event or re-uploading the same bytes is recorded as duplicate; use Replay an event to give an object another pass.


Create an ingest rule

POST /transcodely.v1.IngestRuleService/Create

Parameters

ParameterTypeRequiredDescription
origin_idstringYesThe origin to watch (ori_ prefix). Must be active and have read permission.
namestringYes1 to 255 characters.
filtersobjectNoSee Filters. Omit to act on everything in the bucket.
actionobjectYesSee Action. At least one output and exactly one of managed or output_origin_id.
enabledbooleanNoDefault true. Send false to create it paused and turn it on once the sender is set up.
app_idstringNoAPI-key callers may omit it (their key’s app is used). Dashboard sessions pass it to choose the app; omitted, the organization’s first active app is used.

Returns

The rule in rule and its inbound secret, returned only here.

curl -X POST https://api.transcodely.com/transcodely.v1.IngestRuleService/Create 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{
    "origin_id": "ori_a1b2c3d4e5f6",
    "name": "Watch uploads/",
    "filters": { "prefix": "uploads/", "suffixes": [".mp4", ".mov"], "min_bytes": 1024 },
    "action": { "outputs": [{ "preset": "pst_x9y8z7w6v5" }], "managed": true }
  }'
const { rule, secret } = await client.ingestRules.create({
  originId: "ori_a1b2c3d4e5f6",
  name: "Watch uploads/",
  filters: { prefix: "uploads/", suffixes: [".mp4", ".mov"], minBytes: 1024n },
  action: { outputs: [{ preset: "pst_x9y8z7w6v5" }], managed: true },
});
console.log(rule?.endpointUrl, secret); // store the secret now
created = client.ingest_rules.create(
    origin_id="ori_a1b2c3d4e5f6",
    name="Watch uploads/",
    filters={"prefix": "uploads/", "suffixes": [".mp4", ".mov"], "min_bytes": 1024},
    action={"outputs": [{"preset": "pst_x9y8z7w6v5"}], "managed": True},
)
print(created.rule.endpoint_url, created.secret)  # store the secret now
created, err := client.IngestRules.Create(ctx, &transcodely.IngestRuleCreateParams{
	OriginId: "ori_a1b2c3d4e5f6",
	Name:     "Watch uploads/",
	Filters: &transcodely.IngestRuleFilters{
		Prefix:   "uploads/",
		Suffixes: []string{".mp4", ".mov"},
		MinBytes: 1024,
	},
	Action: &transcodely.IngestRuleAction{
		Outputs: []*transcodely.OutputSpec{{Preset: proto.String("pst_x9y8z7w6v5")}},
		Managed: true,
	},
})
// created.Rule.GetEndpointUrl(), created.Secret: store the secret now
{
  "rule": {
    "id": "ing_a1b2c3d4e5f6",
    "app_id": "app_k1l2m3n4o5",
    "origin_id": "ori_a1b2c3d4e5f6",
    "name": "Watch uploads/",
    "enabled": true,
    "endpoint_url": "https://api.transcodely.com/ingest/ing_a1b2c3d4e5f6",
    "secret_prefix": "ings_a1b",
    "secret_hint": "z9y8",
    "events_received": "0",
    "jobs_created": "0",
    "last_event_at": null,
    "created_at": "2026-11-20T09:00:00Z",
    "updated_at": "2026-11-20T09:00:00Z"
  },
  "secret": "ings_a1b2c3d4e5f6g7h8i9j0z9y8"
}

An origin without read permission is refused with failed_precondition and error code origin_not_readable.


Retrieve an ingest rule

POST /transcodely.v1.IngestRuleService/Get

Parameters

ParameterTypeRequiredDescription
idstringYesThe rule (ing_ prefix).

Returns

The rule in rule, without its secret.

curl -X POST https://api.transcodely.com/transcodely.v1.IngestRuleService/Get 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"id": "ing_a1b2c3d4e5f6"}'
const rule = await client.ingestRules.get("ing_a1b2c3d4e5f6");
rule = client.ingest_rules.get("ing_a1b2c3d4e5f6")
rule, err := client.IngestRules.Get(ctx, "ing_a1b2c3d4e5f6")

List ingest rules

Lists rules, newest first.

POST /transcodely.v1.IngestRuleService/List

Parameters

ParameterTypeRequiredDescription
origin_idstringNoOnly rules on this origin.
enabledbooleanNoOnly enabled, or only disabled, rules.
paginationobjectNolimit (default 50, at most 100) and cursor, the previous response’s next_cursor, sent with the same filters. offset applies only when no cursor is sent.
app_idstringNoAPI-key callers may omit it. Dashboard sessions that omit it get every app in the organization.

Returns

rules, pagination.next_cursor (empty on the last page) and pagination.total_count. Pass next_cursor back unchanged, with the same filters, for the next page; the SDKs’ auto-paging does this for you. A cursor issued for other filters or another app is refused with invalid_argument. See Pagination.

curl -X POST https://api.transcodely.com/transcodely.v1.IngestRuleService/List 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"enabled": true, "pagination": {"limit": 50, "offset": 0}}'
const page = await client.ingestRules.list({ enabled: true, pagination: { limit: 50, offset: 0 } });
for (const rule of page.items) console.log(rule.id, rule.name);
for rule in client.ingest_rules.list(enabled=True, limit=50):
    print(rule.id, rule.name)
iter := client.IngestRules.List(ctx, &transcodely.IngestRuleListParams{Enabled: proto.Bool(true)})
for iter.Next() {
	fmt.Println(iter.Current().GetId())
}
{
  "rules": [
    {
      "id": "ing_a1b2c3d4e5f6",
      "app_id": "app_k1l2m3n4o5",
      "origin_id": "ori_a1b2c3d4e5f6",
      "name": "Watch uploads/",
      "enabled": true,
      "endpoint_url": "https://api.transcodely.com/ingest/ing_a1b2c3d4e5f6"
    }
  ],
  "pagination": { "next_cursor": "", "total_count": "1" }
}

Update an ingest rule

Changes only what the request carries. A filter you send replaces that filter and the others keep their values; the same for each part of the action. List and map fields (outputs, suffixes, metadata, …) are replaced whole.

POST /transcodely.v1.IngestRuleService/Update

Parameters

ParameterTypeRequiredDescription
idstringYesThe rule (ing_ prefix).
namestringNoNew name.
enabledbooleanNoPause or resume. Resuming reports how many events were skipped while paused.
filtersobjectNoFilters to change.
actionobjectNoParts of the action to change. Send managed: true or output_origin_id to move the outputs, never both. managed: false changes nothing.
rotate_secretbooleanNoIssue a new secret. The previous one keeps working for 24 hours.
clear_filtersbooleanNoEmpty the filter set before applying filters. Alone, it widens the rule to the whole bucket.
clear_actionbooleanNoReplace the action outright. action must then be complete: at least one output and exactly one destination. This is how thumbnails or metadata are removed.

Returns

The rule in rule; the new secret when rotate_secret was set (returned only here); and events_skipped_while_disabled, the number of objects declined while the rule was paused, when the update turned it back on. Those can be replayed.

curl -X POST https://api.transcodely.com/transcodely.v1.IngestRuleService/Update 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"id": "ing_a1b2c3d4e5f6", "filters": {"prefix": "raw/"}}'
const { rule } = await client.ingestRules.update({ id: "ing_a1b2c3d4e5f6", filters: { prefix: "raw/" } });
updated = client.ingest_rules.update(id="ing_a1b2c3d4e5f6", filters={"prefix": "raw/"})
updated, err := client.IngestRules.Update(ctx, &transcodely.IngestRuleUpdateParams{
	Id:      "ing_a1b2c3d4e5f6",
	Filters: &transcodely.IngestRuleFilters{Prefix: "raw/"},
})

Delete an ingest rule

Deletes the rule. Its endpoint stops accepting events at once. The events it already received are kept.

POST /transcodely.v1.IngestRuleService/Delete

Parameters

ParameterTypeRequiredDescription
idstringYesThe rule (ing_ prefix).

Returns

The rule as it was, in rule.

curl -X POST https://api.transcodely.com/transcodely.v1.IngestRuleService/Delete 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"id": "ing_a1b2c3d4e5f6"}'
const deleted = await client.ingestRules.delete("ing_a1b2c3d4e5f6");
deleted = client.ingest_rules.delete("ing_a1b2c3d4e5f6")
deleted, err := client.IngestRules.Delete(ctx, "ing_a1b2c3d4e5f6")

List events

Lists the storage events a rule, or every rule in scope, received, newest first, with the outcome of each.

POST /transcodely.v1.IngestRuleService/ListEvents

Parameters

ParameterTypeRequiredDescription
rule_idstringNoOnly events of this rule.
statusstringNoOnly events with this status: received, matched, skipped, created or failed.
paginationobjectNolimit (default 50, at most 100) and cursor, as with List ingest rules. offset applies only when no cursor is sent.
app_idstringNoAPI-key callers may omit it. Dashboard sessions that omit it get every app in the organization.

Returns

events, and pagination.total_count.

curl -X POST https://api.transcodely.com/transcodely.v1.IngestRuleService/ListEvents 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"rule_id": "ing_a1b2c3d4e5f6", "status": "skipped"}'
import { StorageEventStatus } from "@transcodely/sdk";

const page = await client.ingestRules.listEvents({ ruleId: "ing_a1b2c3d4e5f6", status: StorageEventStatus.SKIPPED });
for (const event of page.items) console.log(event.id, event.objectKey, event.reason);
for event in client.ingest_rules.list_events(rule_id="ing_a1b2c3d4e5f6", status="skipped"):
    print(event.id, event.object_key, event.reason)
iter := client.IngestRules.ListEvents(ctx, &transcodely.IngestEventListParams{RuleId: proto.String("ing_a1b2c3d4e5f6")})
for iter.Next() {
	event := iter.Current()
	fmt.Println(event.GetId(), event.GetObjectKey(), event.GetReason())
}
{
  "events": [
    {
      "id": "sev_a1b2c3d4e5f6g7",
      "rule_id": "ing_a1b2c3d4e5f6",
      "app_id": "app_k1l2m3n4o5",
      "bucket": "my-uploads",
      "object_key": "uploads/notes.txt",
      "etag": "9b2cf535f27731c974343645a3985328",
      "size_bytes": "2048",
      "content_type": "text/plain",
      "source": "s3_sns",
      "status": "skipped",
      "reason": "filter_suffix",
      "job_id": "",
      "received_at": "2026-12-03T17:42:10Z",
      "processed_at": "2026-12-03T17:42:10Z"
    }
  ],
  "pagination": { "next_cursor": "", "total_count": "1" }
}

Test a rule

Dry-runs an object key against a rule: whether its filters match and, when they do, the exact job request the rule would submit. Nothing is stored and no job is created.

POST /transcodely.v1.IngestRuleService/Test

Parameters

ParameterTypeRequiredDescription
idstringYesThe rule (ing_ prefix).
object_keystringYesThe key to test, for example uploads/clip.mp4.
bucketstringNoOmit to use the rule’s origin bucket.
size_bytesintegerNoFor the size filters. 0 means unspecified, not an empty file.
content_typestringNoFor the content-type filter.
etagstringNoChanges no filter decision. Supply it to see the idempotency key the real job will carry.

Returns

matched; reason when it would not match (same values as an event’s reason); and job_request, the job that would be created, when it would.

curl -X POST https://api.transcodely.com/transcodely.v1.IngestRuleService/Test 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"id": "ing_a1b2c3d4e5f6", "object_key": "uploads/clip.mp4", "size_bytes": 52428800}'
const result = await client.ingestRules.test({ id: "ing_a1b2c3d4e5f6", objectKey: "uploads/clip.mp4", sizeBytes: 52428800n });
console.log(result.matched, result.reason, result.jobRequest?.inputPath);
result = client.ingest_rules.test(id="ing_a1b2c3d4e5f6", object_key="uploads/clip.mp4", size_bytes=52428800)
result, err := client.IngestRules.Test(ctx, &transcodely.IngestRuleTestParams{
	Id:        "ing_a1b2c3d4e5f6",
	ObjectKey: "uploads/clip.mp4",
	SizeBytes: 52428800,
})
{
  "matched": true,
  "reason": "",
  "job_request": {
    "input_origin_id": "ori_a1b2c3d4e5f6",
    "input_path": "uploads/clip.mp4",
    "outputs": [{ "preset": "pst_x9y8z7w6v5" }],
    "managed": true,
    "priority": "standard",
    "metadata": { "ingest_rule_id": "ing_a1b2c3d4e5f6", "ingest_object_key": "uploads/clip.mp4" },
    "idempotency_key": "ingest_4f6c2a…",
    "app_id": "app_k1l2m3n4o5"
  }
}

Replay an event

Re-queues a skipped or failed event so the object gets one more pass through the rule: for example one that arrived while the rule was paused, or was refused while the account was over its spend limit. The event is reset, not copied, so it keeps its id.

POST /transcodely.v1.IngestRuleService/ReplayEvent

Parameters

ParameterTypeRequiredDescription
event_idstringYesThe event (sev_ prefix).

Returns

The event in event, back in received.

An event that is not skipped or failed is refused with failed_precondition and error code storage_event_not_replayable.

curl -X POST https://api.transcodely.com/transcodely.v1.IngestRuleService/ReplayEvent 
  -H "Authorization: Bearer ak_your_api_key" 
  -H "Content-Type: application/json" 
  -d '{"event_id": "sev_a1b2c3d4e5f6g7"}'
const event = await client.ingestRules.replayEvent("sev_a1b2c3d4e5f6g7");
event = client.ingest_rules.replay_event("sev_a1b2c3d4e5f6g7")
event, err := client.IngestRules.ReplayEvent(ctx, "sev_a1b2c3d4e5f6g7")

Errors

Connect codeError codeCause
not_foundingest_rule_not_foundThe ing_ does not exist or belongs to another app.
not_foundstorage_event_not_foundThe sev_ does not exist or belongs to another app.
failed_preconditionorigin_not_readableThe origin does not have read permission.
failed_preconditionstorage_event_not_replayableOnly skipped and failed events can be replayed.
invalid_argumentA field failed validation, for example max_bytes below min_bytes, both managed and output_origin_id, or a metadata key starting with transcodely_.
permission_deniedA dashboard session with the viewer role tried to change something, or an API key named another app.

Run this against your own file

A free account runs standard-quality encodes up to 2 minutes, one at a time (a longer upload is shortened to its first 2 minutes), so the Quickstart runs with nothing set up but an API key.