MCPcopy Index your code
hub / github.com/triggerdotdev/trigger.dev / registerSchedule

Method registerSchedule

packages/trigger-sdk/src/apiClient.ts:387–409  ·  view source on GitHub ↗
(client: string, id: string, key: string, payload: ScheduleMetadata)

Source from the content-addressed store, hash-verified

385 }
386
387 async registerSchedule(client: string, id: string, key: string, payload: ScheduleMetadata) {
388 const apiKey = await this.#apiKey();
389
390 this.#logger.debug("registering schedule", {
391 id,
392 payload,
393 });
394
395 const response = await zodfetch(
396 RegisterScheduleResponseBodySchema,
397 `${this.#apiUrl}/api/v1/${client}/schedules/${id}/registrations`,
398 {
399 method: "POST",
400 headers: {
401 "Content-Type": "application/json",
402 Authorization: `Bearer ${apiKey}`,
403 },
404 body: JSON.stringify({ id: key, ...payload }),
405 }
406 );
407
408 return response;
409 }
410
411 async unregisterSchedule(client: string, id: string, key: string) {
412 const apiKey = await this.#apiKey();

Callers 1

registerMethod · 0.45

Calls 3

#apiKeyMethod · 0.95
zodfetchFunction · 0.70
debugMethod · 0.65

Tested by

no test coverage detected