Looks up one job by its exact name and hands back its id, without having to list every job and filter yourself. Job names are unique among active jobs, so this always returns at most one result.
Having trouble reaching the API, or logging in from another machine? See Network Access & Authentication Security -- by default the Api only answers
localhost, and PowerShell needs an extra flag once it does answer elsewhere.
Order of Operations
- Authenticate to the API.
- Look up the job by name.
The call
GET /api/jobs/by-name/{jobName}
{jobName} is the job's exact name, URL-encoded if it contains spaces or other special characters (e.g. a space becomes %20). No query parameters, no request body.
Permission needed: Job.View.
C# example
var jsonOptions = new JsonSerializerOptions(JsonSerializerDefaults.Web);
// Step 1: Authenticate to the API.
using var handler = new HttpClientHandler { UseDefaultCredentials = true };
using var client = new HttpClient(handler) { BaseAddress = new Uri("http://your-minion-agent-server:5443") };
client.DefaultRequestHeaders.Add("X-App-Name", "MyIntegration");
// Step 2: Look up the job by name.
var jobName = Uri.EscapeDataString("Nightly ETL Load");
var response = await client.GetAsync($"/api/jobs/by-name/{jobName}");
if (response.StatusCode == System.Net.HttpStatusCode.NotFound)
{
Console.WriteLine("No job with that name.");
}
else
{
response.EnsureSuccessStatusCode();
var job = await response.Content.ReadFromJsonAsync<JobSummary>(jsonOptions);
Console.WriteLine($"Job id: {job!.JobID}");
}
record JobSummary(int JobID, string JobName, string? Description, int? FolderId, bool IsActive,
DateTime CreatedAt, DateTime? ModifiedAt, int? TargetServerId, string? TargetServerName,
string? WorkerName, bool IsGlobal);
Not on a domain machine? Swap in the app-account login from Calling the API From Your Own Code, same as every other page here.
PowerShell example
# Step 1: Authenticate to the API.
$headers = @{ "X-App-Name" = "MyIntegration" }
# Step 2: Look up the job by name. (-AllowUnencryptedAuthentication: PowerShell requires this for Windows auth over plain http to anything but localhost -- see "Network Access & Authentication Security".)
$jobName = [Uri]::EscapeDataString("Nightly ETL Load")
try {
$job = Invoke-RestMethod -Uri "http://your-minion-agent-server:5443/api/jobs/by-name/$jobName" `
-UseDefaultCredentials -AllowUnencryptedAuthentication -Headers $headers
"Job id: $($job.jobID)"
}
catch [Microsoft.PowerShell.Commands.HttpResponseException] {
if ($_.Exception.Response.StatusCode -eq 404) {
"No job with that name."
} else {
throw
}
}
What you get back
200 OK, the same shape as one entry from List Jobs:
{
"jobID": 42,
"jobName": "Nightly ETL Load",
"description": "Loads the warehouse tables from the OLTP source.",
"folderId": 3,
"isActive": true,
"createdAt": "2026-01-14T09:00:00Z",
"modifiedAt": "2026-08-30T14:22:11Z",
"targetServerId": 7,
"targetServerName": "SQLPROD01",
"workerName": null,
"isGlobal": false
}
If no active job has that exact name, you get a 404 instead of an empty/null body -- treat a 404 here the same way you'd treat "not found," not as an error worth retrying.
Codes this call can return
See API Response Codes for what each one means in general. For this specific call:
- 200 -- found it.
- 403 -- you don't have
Job.Viewanywhere. - 404 -- no active job has that exact name.