Skip to main content
PATCH
/
api
/
v2
/
projects
/
{projectKey}
/
agent-optimizations
/
{optimizationKey}
/
results
/
{resultId}
Update an agent optimization result
curl --request PATCH \
  --url https://app.launchdarkly.com/api/v2/projects/{projectKey}/agent-optimizations/{optimizationKey}/results/{resultId} \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "evaluationTokens": {
    "key": ""
  },
  "generationTokens": {
    "key": ""
  },
  "generationLatency": 0,
  "activity": "PENDING",
  "scores": {
    "key": ""
  },
  "completionResponse": "completionResponse",
  "variation": {
    "key": ""
  },
  "evaluationLatencies": {
    "key": ""
  },
  "status": "RUNNING",
  "createdVariationKey": "createdVariationKey"
}
'
{
  "instructions": "instructions",
  "generationTokens": {
    "key": ""
  },
  "completedAt": 5,
  "activity": "PENDING",
  "_links": {
    "parent": {
      "href": "href",
      "type": "type"
    },
    "self": {
      "href": "href",
      "type": "type"
    }
  },
  "scores": {
    "key": ""
  },
  "variation": {
    "key": ""
  },
  "evaluationLatencies": {
    "key": ""
  },
  "createdVariationKey": "createdVariationKey",
  "evaluationTokens": {
    "key": ""
  },
  "createdAt": 5,
  "agentOptimizationId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "generationLatency": 1,
  "_access": {
    "allowed": [
      {
        "reason": {
          "role_name": "role_name",
          "notActions": [
            null,
            null
          ],
          "notResources": [
            "notResources",
            "notResources"
          ],
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ]
        },
        "action": "action"
      },
      {
        "reason": {
          "role_name": "role_name",
          "notActions": [
            null,
            null
          ],
          "notResources": [
            "notResources",
            "notResources"
          ],
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ]
        },
        "action": "action"
      }
    ],
    "denied": [
      {
        "reason": {
          "role_name": "role_name",
          "notActions": [
            null,
            null
          ],
          "notResources": [
            "notResources",
            "notResources"
          ],
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ]
        },
        "action": "action"
      },
      {
        "reason": {
          "role_name": "role_name",
          "notActions": [
            null,
            null
          ],
          "notResources": [
            "notResources",
            "notResources"
          ],
          "effect": "allow",
          "resources": [
            "proj/*:env/*;qa_*:/flag/*"
          ],
          "actions": [
            "*"
          ]
        },
        "action": "action"
      }
    ]
  },
  "agentOptimizationVersion": 0,
  "completionResponse": "completionResponse",
  "iteration": 6,
  "id": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "runId": "046b6c7f-0b8a-43b9-b35d-6489e6daee91",
  "userInput": "userInput",
  "parameters": {
    "key": ""
  },
  "status": "RUNNING",
  "updatedAt": 2
}

Documentation Index

Fetch the complete documentation index at: https://launchdarkly-preview.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Path Parameters

projectKey
string
required
optimizationKey
string
required
resultId
string<uuid>
required

Body

application/json

Agent optimization result fields to update

status
enum<string>
Available options:
RUNNING,
PASSED,
FAILED,
ERRORED
activity
enum<string>
Available options:
PENDING,
GENERATING,
EVALUATING,
GENERATING_VARIATION,
COMPLETED
completionResponse
string
variation
object
scores
object
generationTokens
object
evaluationTokens
object
generationLatency
integer
evaluationLatencies
object
createdVariationKey
string

Response

Agent optimization result updated

id
string<uuid>
required
runId
string<uuid>
required
agentOptimizationId
string<uuid>
required
agentOptimizationVersion
integer
required
status
enum<string>
required
Available options:
RUNNING,
PASSED,
FAILED,
ERRORED
activity
enum<string>
required
Available options:
PENDING,
GENERATING,
EVALUATING,
GENERATING_VARIATION,
COMPLETED
iteration
integer
required
instructions
string
required
userInput
string
required
createdAt
integer<int64>
required
updatedAt
integer<int64>
required
_access
object
Example:
{
"allowed": [
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
}
],
"denied": [
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
},
{
"reason": {
"role_name": "role_name",
"notActions": [null, null],
"notResources": ["notResources", "notResources"],
"effect": "allow",
"resources": ["proj/*:env/*;qa_*:/flag/*"],
"actions": ["*"]
},
"action": "action"
}
]
}

The location and content type of related resources

Example:
{
"parent": { "href": "href", "type": "type" },
"self": { "href": "href", "type": "type" }
}
parameters
object
completionResponse
string
variation
object
scores
object
generationTokens
object
evaluationTokens
object
generationLatency
integer
evaluationLatencies
object
completedAt
integer<int64>
createdVariationKey
string