> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.skaitra.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.skaitra.com/_mcp/server.

# Submit a task's result

POST https://jusu-agentura.skaitra.com/api/v1/tasks/{id}/result
Content-Type: application/json

Finishes the task with the result its template expects (`status` plus the template's fields). A task takes one result.

Reference: https://docs.skaitra.com/api/api-zinynas/tasks/submitresult

## Authentication

- `Authorization` header (bearer token, required) — Skaitra API key (`skt_…`).
- `Authorization` header (bearer token, required) — OAuth 2.1 access token issued for the Skaitra resource (`/mcp`); see /.well-known/oauth-protected-resource.

## Request

### Path parameters

- `id` (string, required)

### Headers

- `Idempotency-Key` (string, optional) — Any unique value; a retry with the same key returns the first result.

### Body (application/json)

This endpoint expects an object.

- `status` (string, required)

## Response

### 200

OK

- `id` (string, required)
- `type` (string, required)
- `status` (string, required)
- `attempt` (integer, required)
- `companyId` (string, required)
- `companyName` (string, required, nullable)
- `subject` (TaskSubject, required)
- `instruction` (string, required)
- `humanFeedback` (string, required, nullable)
- `resultStatus` (string, required, nullable)
- `createdBy` (TaskCreatedBy, required)
- `createdAt` (string, required)
- `updatedAt` (string, required)
- `completedAt` (string, required, nullable)

## Errors

### 400 Bad Request Error

The request is invalid; `error.details.issues` lists the problems.

- `error` (ErrorError, required)

### 401 Unauthorized Error

The API key is missing, invalid, expired or revoked.

- `error` (ErrorError, required)

### 403 Forbidden Error

The key lacks a scope or access to the company.

- `error` (ErrorError, required)

### 404 Not Found Error

Not found, or not visible to this key.

- `error` (ErrorError, required)

### 409 Conflict Error

A request with the same Idempotency-Key is still running.

- `error` (ErrorError, required)

### 412 Precondition Failed Error

The resource changed since you read it (If-Match).

- `error` (ErrorError, required)

### 422 Unprocessable Entity Error

The Idempotency-Key was used for a different request.

- `error` (ErrorError, required)

### 428 Precondition Error

The operation needs If-Match.

- `error` (ErrorError, required)

## Types

### TaskSubject

- `type` (string, required)
- `id` (string, required)

### TaskCreatedBy

- `actorType` (string, required)
- `userId` (string, required, nullable)

### ErrorError

- `code` (enum, required)
  - Allowed values: `INVALID_API_KEY`, `INSUFFICIENT_SCOPE`, `COMPANY_ACCESS_DENIED`, `NOT_FOUND`, `VALIDATION_ERROR`, `INVALID_CURSOR`, `METHOD_NOT_ALLOWED`, `PRECONDITION_REQUIRED`, `PRECONDITION_FAILED`, `IDEMPOTENCY_KEY_REUSED`, `IDEMPOTENCY_KEY_IN_USE`, `CONFLICT`, `PAYLOAD_TOO_LARGE`, `UNSUPPORTED_MEDIA_TYPE`, `STORAGE_UNAVAILABLE`, `FORBIDDEN`, `FEATURE_NOT_INCLUDED`, `RATE_LIMITED`, `APPROVAL_REQUIRED`, `APPROVAL_PENDING`, `APPROVAL_REJECTED`, `INTERNAL_ERROR`
- `message` (string, required)
- `hint` (string, optional)
- `details` (map from string to any, optional)

## Examples

**Request**

```json
{
  "status": "string"
}
```

**Response**

```json
{
  "id": "string",
  "type": "string",
  "status": "string",
  "attempt": 1,
  "companyId": "string",
  "companyName": "string",
  "subject": {
    "type": "string",
    "id": "string"
  },
  "instruction": "string",
  "humanFeedback": "string",
  "resultStatus": "string",
  "createdBy": {
    "actorType": "string",
    "userId": "string"
  },
  "createdAt": "string",
  "updatedAt": "string",
  "completedAt": "string"
}
```

**SDK Code**

```python
import requests

url = "https://jusu-agentura.skaitra.com/api/v1/tasks/id/result"

payload = { "status": "string" }
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://jusu-agentura.skaitra.com/api/v1/tasks/id/result';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"status":"string"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://jusu-agentura.skaitra.com/api/v1/tasks/id/result"

	payload := strings.NewReader("{\n  \"status\": \"string\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://jusu-agentura.skaitra.com/api/v1/tasks/id/result")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": \"string\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://jusu-agentura.skaitra.com/api/v1/tasks/id/result")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"string\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://jusu-agentura.skaitra.com/api/v1/tasks/id/result', [
  'body' => '{
  "status": "string"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://jusu-agentura.skaitra.com/api/v1/tasks/id/result");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"string\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["status": "string"] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://jusu-agentura.skaitra.com/api/v1/tasks/id/result")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```