Skip to content

Success

A 200 response with data.

ParameterTypeDescription
statusintegerThe HTTP status code
messagestringThe message to return
dataanyThe data to return

An example Ok response:

{
"status": 200,
"message": "Success",
"data": {
"id": "123",
"name": "Test"
}
}

Here’s an example of how to use the Ok response within a an API operation:

import "@common-grants/core";
import "@typespec/http";
using TypeSpec.Http;
using CommonGrants.Responses;
model TestModel {
id: string;
name: string;
}
@summary("Get test")
@doc("Get a test model")
@get
op getTest(): Ok<TestModel>;