Prerequisites
- Your Splunk On-Call API key and API ID
Setup
Install the in Courier and enter your API key and API ID.Splunk On-Call was formerly known as VictorOps. The API documentation at
portal.victorops.com may redirect to Splunk’s current documentation.Profile requirements
Splunk On-Call addresses the recipient by target type and slug, undersplunk_on_call on the profile. Store it once with , which merges into the profile and creates it if it does not exist:
const profile = await client.profiles.create('user_123', {
profile: {
splunk_on_call: {
target: {
type: 'User',
slug: 'userSlug',
},
},
},
});
profile = client.profiles.create(
user_id="user_123",
profile={
"splunk_on_call": {
"target": {
"type": "User",
"slug": "userSlug",
},
},
},
)
curl --request POST \
--url https://api.courier.com/profiles/user_123 \
--header "Authorization: Bearer $COURIER_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"profile": {
"splunk_on_call": {
"target": {
"type": "User",
"slug": "userSlug"
}
}
}
}'
profile = courier.profiles.create(
"user_123",
profile: {
splunk_on_call: {
target: {
type: "User",
slug: "userSlug"
}
}
}
)
profile, err := client.Profiles.New(
context.TODO(),
"user_123",
courier.ProfileNewParams{
Profile: map[string]any{
"splunk_on_call": map[string]any{
"target": map[string]any{
"type": "User",
"slug": "userSlug",
},
},
},
},
)
ProfileCreateParams params = ProfileCreateParams.builder()
.userId("user_123")
.profile(ProfileCreateParams.Profile.builder()
.putAdditionalProperty("splunk_on_call", JsonValue.from(java.util.Map.of(
"target", java.util.Map.of(
"type", "User",
"slug", "userSlug"))))
.build())
.build();
ProfileCreateResponse profile = client.profiles().create(params);
$profile = $client->profiles->create('user_123', profile: [
'splunk_on_call' => [
'target' => [
'type' => 'User',
'slug' => 'userSlug',
],
],
]);
ProfileCreateParams parameters = new()
{
UserID = "user_123",
Profile = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
"""
{
"splunk_on_call": {
"target": {
"type": "User",
"slug": "userSlug"
}
}
}
"""
),
};
var profile = await client.Profiles.Create(parameters);
courier profiles create \
--api-key "$COURIER_API_KEY" \
--user-id user_123 \
--profile '{"splunk_on_call":{"target":{"type":"User","slug":"userSlug"}}}'
With Courier MCP, save the Splunk On-Call user target userSlug on user_123.
user_id and Courier resolves the address.
For a one-off with no stored profile, pass it inline instead: "to": { "splunk_on_call": { "target": { "type": "User", "slug": "userSlug" } } }.
Send by user id
The call in every language, and the rest of the profile object.
Send to a recipient
- Send to user id
- Send to
splunk_on_call
Courier reads
splunk_on_call off the saved profile, so preferences apply and the value can change without touching this code.const { requestId } = await courier.send.message({
message: {
to: {
user_id: "user_123",
},
template: "nt_01kx4h2jdafq8bk9aftxak4b40",
},
});
response = client.send.message(
message={
"to": {
"user_id": "user_123",
},
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
},
)
curl -X POST https://api.courier.com/send \
-H "Authorization: Bearer $COURIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"to": {
"user_id": "user_123"
},
"template": "nt_01kx4h2jdafq8bk9aftxak4b40"
}
}'
response = courier.send_.message(
message: {
to: {
user_id: "user_123"
},
template: "nt_01kx4h2jdafq8bk9aftxak4b40"
}
)
response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
Message: courier.SendMessageParamsMessage{
To: courier.SendMessageParamsMessageToUnion{
OfUserRecipient: &shared.UserRecipientParam{
UserID: courier.String("user_123"),
},
},
Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
},
})
SendMessageParams params = SendMessageParams.builder()
.message(SendMessageParams.Message.builder()
.to(UserRecipient.builder().userId("user_123").build())
.template("nt_01kx4h2jdafq8bk9aftxak4b40")
.build())
.build();
SendMessageResponse response = client.send().message(params);
$response = $client->send->message(
message: [
'to' => [
'user_id' => 'user_123',
],
'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
],
);
SendMessageParams parameters = new()
{
Message = new()
{
To = new UserRecipient { UserID = "user_123" },
Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
},
};
var response = await client.Send.Message(parameters);
courier send message \
--api-key "$COURIER_API_KEY" \
--message.to '{"user_id": "user_123"}' \
--message.template nt_01kx4h2jdafq8bk9aftxak4b40
With Courier MCP, send my template to user_123 by email.
Pass it inline instead and nothing is stored. Swap this
to object into the call on the other tab.const { requestId } = await courier.send.message({
message: {
// A provider recipient is a profile field, so it sits outside the typed union.
to: {
splunk_on_call: {
target: {
type: "User",
slug: "userSlug",
},
},
} as any,
template: "nt_01kx4h2jdafq8bk9aftxak4b40",
},
});
response = client.send.message(
message={
"to": {
"splunk_on_call": {
"target": {
"type": "User",
"slug": "userSlug",
},
},
},
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
},
)
curl -X POST https://api.courier.com/send \
-H "Authorization: Bearer $COURIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"to": {
"splunk_on_call": {
"target": {
"type": "User",
"slug": "userSlug"
}
}
},
"template": "nt_01kx4h2jdafq8bk9aftxak4b40"
}
}'
response = courier.send_.message(
message: {
to: {
splunk_on_call: {
target: {
type: "User",
slug: "userSlug"
}
}
},
template: "nt_01kx4h2jdafq8bk9aftxak4b40"
}
)
// A provider recipient is a profile field, so it sits outside the typed union.
to := param.Override[shared.UserRecipientParam](
json.RawMessage(`{"splunk_on_call": {"target": {"type": "User", "slug": "userSlug"}}}`),
)
response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
Message: courier.SendMessageParamsMessage{
To: courier.SendMessageParamsMessageToUnion{OfUserRecipient: &to},
Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
},
})
// A provider recipient is a profile field, so it sits outside the typed union.
UserRecipient to = UserRecipient.builder()
.putAdditionalProperty("splunk_on_call", JsonValue.from(Map.of(
"target", Map.of(
"type", "User",
"slug", "userSlug"))))
.build();
client.send().message(SendMessageParams.builder()
.message(SendMessageParams.Message.builder()
.to(to)
.template("nt_01kx4h2jdafq8bk9aftxak4b40")
.build())
.build());
$response = $client->send->message(
message: [
'to' => [
'splunk_on_call' => [
'target' => [
'type' => 'User',
'slug' => 'userSlug',
],
],
],
'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
],
);
// A provider recipient is a profile field, so it sits outside the typed union.
UserRecipient to = UserRecipient.FromRawUnchecked(
JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
"""{"splunk_on_call": {"target": {"type": "User", "slug": "userSlug"}}}"""
)
);
var response = await client.Send.Message(new() { Message = new() { To = to, Template = "nt_01kx4h2jdafq8bk9aftxak4b40" } });
courier send message \
--api-key "$COURIER_API_KEY" \
--message.to '{"splunk_on_call": {"target": {"type": "User", "slug": "userSlug"}}}' \
--message.template nt_01kx4h2jdafq8bk9aftxak4b40
With Courier MCP, send my template to the Splunk On-Call user userSlug.
Template requirements
Provide a summary in the notification’s integration settings.Overrides
covers the two levels and which one wins. You can override the API key, API ID, username, URL, and request body. This example overrides the API key and username throughconfig:
const { requestId } = await courier.send.message({
message: {
template: "nt_01kx4h2jdafq8bk9aftxak4b40",
to: {
splunk_on_call: {
target: {
type: "User",
slug: "sbennett",
},
},
},
providers: {
"splunk-on-call": {
override: {
config: {
apiKey: "RUNTIME_API_KEY",
userName: "RUNTIME_USERNAME",
},
},
},
},
},
});
response = client.send.message(
message={
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
"to": {
"splunk_on_call": {
"target": {
"type": "User",
"slug": "sbennett",
},
},
},
"providers": {
"splunk-on-call": {
"override": {
"config": {
"apiKey": "RUNTIME_API_KEY",
"userName": "RUNTIME_USERNAME",
},
},
},
},
},
)
curl -X POST https://api.courier.com/send \
-H "Authorization: Bearer $COURIER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"message": {
"template": "nt_01kx4h2jdafq8bk9aftxak4b40",
"to": {
"splunk_on_call": {
"target": {
"type": "User",
"slug": "sbennett"
}
}
},
"providers": {
"splunk-on-call": {
"override": {
"config": {
"apiKey": "RUNTIME_API_KEY",
"userName": "RUNTIME_USERNAME"
}
}
}
}
}
}'
response = courier.send_.message(
message: {
template: "nt_01kx4h2jdafq8bk9aftxak4b40",
to: {
splunk_on_call: {
target: {
type: "User",
slug: "sbennett"
}
}
},
providers: {
"splunk-on-call": {
override: {
config: {
apiKey: "RUNTIME_API_KEY",
userName: "RUNTIME_USERNAME"
}
}
}
}
}
)
// This provider addresses the recipient with fields outside the typed
// UserRecipient model, so pass the recipient as raw JSON.
to := param.Override[shared.UserRecipientParam](json.RawMessage(`{
"splunk_on_call": {
"target": {
"type": "User",
"slug": "sbennett"
}
}
}`))
response, err := client.Send.Message(context.TODO(), courier.SendMessageParams{
Message: courier.SendMessageParamsMessage{
To: courier.SendMessageParamsMessageToUnion{OfUserRecipient: &to},
Template: courier.String("nt_01kx4h2jdafq8bk9aftxak4b40"),
Providers: shared.MessageProvidersParam{
"splunk-on-call": shared.MessageProvidersTypeParam{
Override: map[string]any{
"config": map[string]any{
"apiKey": "RUNTIME_API_KEY",
"userName": "RUNTIME_USERNAME",
},
},
},
},
},
})
SendMessageParams params = SendMessageParams.builder()
.message(SendMessageParams.Message.builder()
// This provider addresses the recipient with fields outside the
// typed UserRecipient model, so pass them as additional properties.
.to(UserRecipient.builder()
.putAdditionalProperty("splunk_on_call", JsonValue.from(java.util.Map.of(
"target", java.util.Map.of(
"type", "User",
"slug", "sbennett"
)
)))
.build())
.template("nt_01kx4h2jdafq8bk9aftxak4b40")
.providers(MessageProviders.builder()
.putAdditionalProperty("splunk-on-call", JsonValue.from(java.util.Map.of("override", java.util.Map.of(
"config", java.util.Map.of(
"apiKey", "RUNTIME_API_KEY",
"userName", "RUNTIME_USERNAME"
)
))))
.build())
.build())
.build();
SendMessageResponse response = client.send().message(params);
$response = $client->send->message(
message: [
'template' => 'nt_01kx4h2jdafq8bk9aftxak4b40',
'to' => [
'splunk_on_call' => [
'target' => [
'type' => 'User',
'slug' => 'sbennett',
],
],
],
'providers' => [
'splunk-on-call' => [
'override' => [
'config' => [
'apiKey' => 'RUNTIME_API_KEY',
'userName' => 'RUNTIME_USERNAME',
],
],
],
],
],
);
SendMessageParams parameters = new()
{
Message = new()
{
// This provider addresses the recipient with fields outside the
// typed UserRecipient model, so build it from raw JSON.
To = UserRecipient.FromRawUnchecked(
JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
"""
{
"splunk_on_call": {
"target": {
"type": "User",
"slug": "sbennett"
}
}
}
"""
)
),
Template = "nt_01kx4h2jdafq8bk9aftxak4b40",
Providers = new Dictionary<string, MessageProvidersType>()
{
{
"splunk-on-call",
new()
{
Override = JsonSerializer.Deserialize<Dictionary<string, JsonElement>>(
"""
{
"config": {
"apiKey": "RUNTIME_API_KEY",
"userName": "RUNTIME_USERNAME"
}
}
"""
),
}
},
},
},
};
var response = await client.Send.Message(parameters);
courier send message \
--api-key "$COURIER_API_KEY" \
--message.to '{"splunk_on_call": {"target": {"type": "User", "slug": "sbennett"}}}' \
--message.template nt_01kx4h2jdafq8bk9aftxak4b40 \
--message.providers '{"splunk-on-call": {"override": {"config": {"apiKey": "RUNTIME_API_KEY", "userName": "RUNTIME_USERNAME"}}}}'
With Courier MCP, send my template to Splunk On-Call with a different API key and username.
Provider details
splunk-on-call
routing.channels instead is supported, and sends through just this provider.
Send to a specific provider
When that is worth doing, and what you give up: failover, channel priority, and providers you add later.