Data sources mAPI reference
Complete reference documentation for the Data sources resource.
Data sources
#Data sources are the external services that enable event ingestion into Knock.
List sources
#Returns connected sources for the project.
Endpoint
Query parameters
The environment slug.
Returns
Sources connected to the project.
Sources.
Custom image URL for the source.
Source description.
Source key.
Source display name.
Get a source
#Returns a source with environment-specific settings, preprocess scripts, and event mappings.
Endpoint
Path parameters
The key of the source to retrieve.
Query parameters
The environment slug.
Returns
A source that receives external events and maps them to Knock actions.
The timestamp of when the source was created.
An optional URL for a custom image representing the source.
An optional description of the source.
Per-environment settings keyed by environment slug.
The unique key for the source within the project.
The human-readable name of the source.
The timestamp of when the source was last updated.
Upsert a source
#Creates or updates a source with environment-specific settings, preprocess scripts, and event mappings.
Endpoint
Path parameters
The key of the source to upsert.
Query parameters
The environment slug.
Request body
A source request for setting a source and its environment-specific configuration.
An optional URL for a custom image representing the source.
An optional description of the source.
Per-environment settings keyed by environment slug.
The human-readable name of the source.
When creating a source, bootstraps configuration from a preconfigured provider template. Ignored when updating an existing source.
Returns
Wraps the Source response under the source key.
A source that receives external events and maps them to Knock actions.
The timestamp of when the source was created.
An optional URL for a custom image representing the source.
An optional description of the source.
Per-environment settings keyed by environment slug.
The unique key for the source within the project.
The human-readable name of the source.
The timestamp of when the source was last updated.
Get source status
#Returns source activity and workflow-trigger mappings that need action in the requested environment.
Endpoint
Path parameters
The key of the source whose status should be retrieved.
Query parameters
The environment slug.
Returns
Status information for a source in an environment.
The number of source events received in the last 30 days.
The timestamp of the most recently received source event.
The total number of event action mappings for the source environment.
Workflow trigger event action mappings that need a workflow commit before their changes are applied.
The action that is performed when this mapping matches a source event.
The decoded event type that triggers the action.
The timestamp of when the mapping was deactivated.
Whether the mapping is pending deletion.
The key of the workflow resource referenced by the mapping.
Whether the mapping is pending deletion or update.
Rehearse a source event
#Sends an arbitrary payload through the source's parse, preprocess, and mapping pipeline in the requested environment. This endpoint cannot be run in production environments.
Endpoint
Path parameters
The key of the source to rehearse.
Query parameters
The environment slug.
Request body
An arbitrary payload to send through the source's parse, preprocess, and mapping pipeline.
Returns
The result of a simulated source event rehearsal.
The total number of action logs produced by the rehearsal.
Errors returned while rehearsing the source event.
The number of failed action logs produced by the rehearsal.
The ID of the source event log created by the rehearsal.
Whether the rehearsal completed without action errors.
The number of successful action logs produced by the rehearsal.
List source events
#Returns known unique events received by a source in the requested environment.
Endpoint
Path parameters
The key of the source whose events should be listed.
Query parameters
The environment slug.
Returns
A list of known unique source events.
The known unique events for the requested source and environment.
The decoded event name.
The timestamp of when this event was last received.
List source logs
#Returns event logs received by a source in the requested environment. Supports filtering by date/time, event, and log ID.
Endpoint
Path parameters
The key of the source whose logs should be listed.
Query parameters
The environment slug.
Returns event logs that were produced on this date.
Only return source logs at or after this timestamp.
Only return source logs at or before this timestamp.
The event name to filter by.
The log ID to filter by.
Associated resources to include in the response. Accepts actions to include the actions executed after receiving each source event.
The cursor to fetch entries after.
The cursor to fetch entries before.
The number of entries to fetch per-page.
Returns
A paginated list of source logs. Include actions in the includes query parameter to return action details for each log.
The source logs for the requested source and environment.
The actions executed after receiving the source event. Only present when includes contains actions.
The configured mapping parameters used to derive the action payload.
The parsed values generated from the mapping parameters for this action.
The result returned by the action.
The status of the action.
The type of action that was executed.
The action log ID.
The timestamp of when the action log was created.
The data payload parsed by the source.
The decoded source event name.
The source log ID.
The timestamp of when the source log was created.
The output returned by the preprocess script.
Indicates the origin of the log; if the log is a product of a test event. This is typically null for regular source events received from the data source.
The verification status for the received event.
The information about a paginated result.
The cursor to fetch entries after. Will only be present if there are more entries to fetch.
The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.
The number of entries to fetch per-page.
List source providers
#Returns the source provider templates available for creating sources.
Endpoint
Returns
Source providers available for creating sources.
Source providers.
Provider key.
Provider display metadata.
Provider display description.
Provider display name.
Provider version.
Get a source provider
#Returns a source provider template available for creating sources.
Endpoint
Path parameters
The source provider key to retrieve.
Query parameters
Associated resources to include in the response. Accepts branding, default_action_mappings, example_payloads, preprocessing_script, static_fields.
Returns
A source provider available for creating sources.
Default event action mappings for the provider. Only present when includes contains default_action_mappings.
Action-specific data paths and options.
The action performed when the mapping matches a source event.
Event type to match.
Default source settings for this provider.
Whether the source should enforce webhook verification.
Path to find the event type from the data.
Path to find the idempotency key from the data.
Verification script source code. Only present when includes contains preprocessing_script.
Path to find the timestamp from the data.
Example payloads keyed by event type. Only present when includes contains example_payloads.
Provider key.
Provider display metadata.
Provider branding assets. Only present when includes contains branding.
Provider categories for filtering and grouping.
Provider display description.
Knock tutorial URL for setting up the provider.
Provider display name.
Provider webhook configuration URL.
Provider webhook documentation URL.
Provider website URL.
JSON Schema fields needed to configure the source. Only present when includes contains static_fields.
Provider version.
Source
#A source that receives external events and maps them to Knock actions.
Attributes
The timestamp of when the source was created.
An optional URL for a custom image representing the source.
An optional description of the source.
Per-environment settings keyed by environment slug.
The unique key for the source within the project.
The human-readable name of the source.
The timestamp of when the source was last updated.
SourceRequest
#A source request for setting a source and its environment-specific configuration.
Attributes
An optional URL for a custom image representing the source.
An optional description of the source.
Per-environment settings keyed by environment slug.
The human-readable name of the source.
When creating a source, bootstraps configuration from a preconfigured provider template. Ignored when updating an existing source.
SourcePreprocessScript
#A script that runs before source events are mapped.
Attributes
The programming language used by the preprocess script.
The source code for the preprocess script.
SourceEnvironmentSettings
#Environment-specific settings for a source.
Attributes
The timestamp of when these environment settings were created.
Event action mappings configured for this source in the environment.
The action-specific parameters for the mapping.
The action that is performed when this mapping matches a source event.
The timestamp of when the mapping was created.
The decoded event type that triggers the action.
The timestamp of when the mapping was deactivated.
Whether the mapping has been deleted. When true, this indicates the trigger is present in the workflow's published version and may be active until the workflow is committed and published.
The timestamp of when the mapping was last updated.
Source settings for this environment, including endpoint, verification behavior, and preprocess script.
The public endpoint that receives source events for this environment.
The resolved preprocess script for this source environment, if configured.
The timestamp of when these environment settings were last updated.
SourceEvent
#A known unique event received by a source.
Attributes
The decoded event name.
The timestamp of when this event was last received.
SourceEventsResponse
#A list of known unique source events.
Attributes
The known unique events for the requested source and environment.
The decoded event name.
The timestamp of when this event was last received.
SourceEventActionMapping
#An action mapping attached to a source event.
Attributes
The action-specific parameters for the mapping.
The action that is performed when this mapping matches a source event.
The timestamp of when the mapping was created.
The decoded event type that triggers the action.
The timestamp of when the mapping was deactivated.
Whether the mapping has been deleted. When true, this indicates the trigger is present in the workflow's published version and may be active until the workflow is committed and published.
The timestamp of when the mapping was last updated.
SourceLog
#A log entry for an event received by a source.
Attributes
The actions executed after receiving the source event. Only present when includes contains actions.
The configured mapping parameters used to derive the action payload.
The parsed values generated from the mapping parameters for this action.
The result returned by the action.
The status of the action.
The type of action that was executed.
The action log ID.
The timestamp of when the action log was created.
The data payload parsed by the source.
The decoded source event name.
The source log ID.
The timestamp of when the source log was created.
The output returned by the preprocess script.
Indicates the origin of the log; if the log is a product of a test event. This is typically null for regular source events received from the data source.
The verification status for the received event.
SourceLogAction
#An action executed after receiving a source event.
Attributes
The configured mapping parameters used to derive the action payload.
The parsed values generated from the mapping parameters for this action.
The result returned by the action.
The status of the action.
The type of action that was executed.
The action log ID.
The timestamp of when the action log was created.
SourceLogsResponse
#A paginated list of source logs. Include actions in the includes query parameter to return action details for each log.
Attributes
The source logs for the requested source and environment.
The actions executed after receiving the source event. Only present when includes contains actions.
The configured mapping parameters used to derive the action payload.
The parsed values generated from the mapping parameters for this action.
The result returned by the action.
The status of the action.
The type of action that was executed.
The action log ID.
The timestamp of when the action log was created.
The data payload parsed by the source.
The decoded source event name.
The source log ID.
The timestamp of when the source log was created.
The output returned by the preprocess script.
Indicates the origin of the log; if the log is a product of a test event. This is typically null for regular source events received from the data source.
The verification status for the received event.
The information about a paginated result.
The cursor to fetch entries after. Will only be present if there are more entries to fetch.
The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.
The number of entries to fetch per-page.
SourceProviderResponse
#A source provider available for creating sources.
Attributes
Default event action mappings for the provider. Only present when includes contains default_action_mappings.
Action-specific data paths and options.
The action performed when the mapping matches a source event.
Event type to match.
Default source settings for this provider.
Whether the source should enforce webhook verification.
Path to find the event type from the data.
Path to find the idempotency key from the data.
Verification script source code. Only present when includes contains preprocessing_script.
Path to find the timestamp from the data.
Example payloads keyed by event type. Only present when includes contains example_payloads.
Provider key.
Provider display metadata.
Provider branding assets. Only present when includes contains branding.
Provider categories for filtering and grouping.
Provider display description.
Knock tutorial URL for setting up the provider.
Provider display name.
Provider webhook configuration URL.
Provider webhook documentation URL.
Provider website URL.
JSON Schema fields needed to configure the source. Only present when includes contains static_fields.
Provider version.
SourceProvidersResponse
#Source providers available for creating sources.
Attributes
Source providers.
Provider key.
Provider display metadata.
Provider display description.
Provider display name.
Provider version.
SourceRehearseRequest
#Request body for rehearsing a source event.
Attributes
An arbitrary payload to send through the source's parse, preprocess, and mapping pipeline.
SourceRehearseResponse
#The result of a simulated source event rehearsal.
Attributes
The total number of action logs produced by the rehearsal.
Errors returned while rehearsing the source event.
The number of failed action logs produced by the rehearsal.
The ID of the source event log created by the rehearsal.
Whether the rehearsal completed without action errors.
The number of successful action logs produced by the rehearsal.
SourceStatusResponse
#Status information for a source in an environment.
Attributes
The number of source events received in the last 30 days.
The timestamp of the most recently received source event.
The total number of event action mappings for the source environment.
Workflow trigger event action mappings that need a workflow commit before their changes are applied.
The action that is performed when this mapping matches a source event.
The decoded event type that triggers the action.
The timestamp of when the mapping was deactivated.
Whether the mapping is pending deletion.
The key of the workflow resource referenced by the mapping.
Whether the mapping is pending deletion or update.
SourcesResponse
#Sources connected to the project.
Attributes
Sources.
Custom image URL for the source.
Source description.
Source key.
Source display name.