> For the complete documentation index, see [llms.txt](https://developers-apps-in-toss.toss.im/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers-apps-in-toss.toss.im/api/en/sdk.md).

# Data SDK

## View consent-based user data

> Check the user's consent status for consent-based user data items registered in the mini app. If the user has agreed to the latest consent details, return the actual data value; if they have not yet consented or have refused consent, return a URL that can take them to the consent screen instead of the data.\
> \
> \### Business error code\
> \
> The errors below return with HTTP 200 and \`resultType: FAIL\` response.\
> \
> \| errorCode | Description                                    |\
> \| --------- | ---------------------------------------------- |\
> \| \`4010\`    | Authentication information could not be found. |

```json
{"openapi":"3.1.0","info":{"title":"Apps in Toss Partner API","version":"1.0.0"},"tags":[{"description":"An API used when a partner retrieves personal information for which the user has given consent.","name":"sdk"}],"servers":[{"description":"Operations (for simple login, message sending, Toss Points payout, etc.)","url":"https://apps-in-toss-api.toss.im"}],"security":[{"mutualTLS":[]}],"components":{"securitySchemes":{"mutualTLS":{"description":"This is mTLS authentication based on a client certificate issued to the partner. The mini app is identified by the certificate's CN. For how to issue and manage certificates, [Using the server API](https://developers-apps-in-toss.toss.im/documentation/integration/server-api) please refer to the documentation.","type":"mutualTLS"}},"schemas":{"DataSdkConsentedUserDataRequest":{"description":"This is the request body for consent-based user data inquiry.","properties":{"consentedUserDataKey":{"description":"This is the key that identifies the consent-based user data item to be retrieved. It is issued when you register a consent-based user data item in the partner workspace console.","type":"string"}},"required":["consentedUserDataKey"]},"TossApiSuccessDataSdkConsentedUserDataResponse":{"description":"This is the success response envelope.","properties":{"resultType":{"description":"This is the processing result. On success, `SUCCESS` it is.","enum":["SUCCESS"],"type":"string"},"success":{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"}},"required":["resultType","success"],"type":"object"},"DataSdkConsentedUserDataResponse":{"description":"This is the consent-based user data inquiry result. `type` The actual returned fields vary depending on the value.","discriminator":{"propertyName":"type"},"oneOf":[{"$ref":"#/components/schemas/Provided"},{"$ref":"#/components/schemas/UserNotConsented"},{"$ref":"#/components/schemas/UserDeclined"},{"$ref":"#/components/schemas/TermsNotSet"},{"$ref":"#/components/schemas/Unavailable"}],"properties":{"type":{"description":"This is the discriminator that indicates the type of response result.","enum":["PROVIDED","USER_NOT_CONSENTED","USER_DECLINED","TERMS_NOT_SET","UNAVAILABLE"],"type":"string"}},"required":["type"]},"Provided":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"},{"properties":{"data":{"additionalProperties":{"type":"string"},"description":"These are the actual values of the data items you agreed to provide. The key is the data item (DataScopeKey), and the value is the string to display on screen.","type":"object"}},"type":"object"}],"description":"This is the response that provides the actual data values for the requested items because the user agreed to the latest consent terms.","required":["data","type"]},"UserNotConsented":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"},{"properties":{"termsUrl":{"description":"This is the consent screen URL where the user can consent.","type":"string"}},"type":"object"}],"description":"The user has not yet responded to the consent request. `termsUrl` Please show the consent screen with","required":["termsUrl","type"]},"UserDeclined":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"},{"properties":{"termsUrl":{"description":"This is the consent screen URL where the user can consent again.","type":"string"}},"type":"object"}],"description":"The user has explicitly denied consent. `termsUrl` You can show the consent screen again with","required":["termsUrl","type"]},"TermsNotSet":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"}],"description":"The terms URL to display on the consent screen has not been set yet, so the consent status cannot be shown.","required":["type"]},"Unavailable":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"}],"description":"The user's consent status cannot be checked due to a temporary error, etc.","required":["type"]},"TossApiFail":{"description":"This is the failure response envelope. Business errors are returned with HTTP 200, so `resultType` be sure to check it.","properties":{"error":{"$ref":"#/components/schemas/TossApiError"},"resultType":{"description":"This is the processing result. `SUCCESS` Treat all values other than `FAIL` as failure. Generally,","enum":["FAIL","HTTP_TIMEOUT","NETWORK_ERROR","EXECUTION_FAIL","INTERRUPTED","INTERNAL_ERROR"],"type":"string"},"success":{"description":"It is always null on failure."}},"required":["error","resultType"],"type":"object"},"TossApiError":{"description":"This is detailed error information.","properties":{"data":{"description":"Additional error information. When the request limit is exceeded `retryAfterSeconds` is included.","type":"object"},"errorCode":{"description":"This is the error code. Refer to each API's business error code table.","type":"string"},"errorType":{"description":"This is an internal error classification value. For error categorization, `errorCode` use it.","format":"int32","type":"integer"},"reason":{"description":"This is a human-readable error description.","type":"string"},"title":{"description":"This is the error title. It is usually null.","type":"string"}},"required":["errorCode","reason"],"type":"object"},"TossApiValidationFail":{"description":"This is the response when request field validation fails.","properties":{"error":{"$ref":"#/components/schemas/TossApiValidationFailError"},"resultType":{"description":"This is the processing result. `SUCCESS` Treat all values other than `FAIL` as failure. Generally,","enum":["FAIL","HTTP_TIMEOUT","NETWORK_ERROR","EXECUTION_FAIL","INTERRUPTED","INTERNAL_ERROR"],"type":"string"},"success":{"description":"It is always null on failure."}},"required":["error","resultType"],"type":"object"},"TossApiValidationFailError":{"description":"This is detailed error information.","properties":{"data":{"description":"Additional error information. When the request limit is exceeded `retryAfterSeconds` is included.","properties":{"errorDetails":{"description":"This is a detailed list of field-level validation failures.","items":{"$ref":"#/components/schemas/TossApiFieldError"},"type":"array"}},"type":"object"},"errorCode":{"description":"This is the error code. Refer to each API's business error code table.","type":"string"},"errorType":{"description":"This is an internal error classification value. For error categorization, `errorCode` use it.","format":"int32","type":"integer"},"reason":{"description":"This is a human-readable error description.","type":"string"},"title":{"description":"This is the error title. It is usually null.","type":"string"}},"required":["errorCode","reason"],"type":"object"},"TossApiFieldError":{"description":"This is a detailed list of field-level validation failures.","properties":{"field":{"description":"This is the name of the field that failed validation.","type":"string"},"message":{"description":"This is the reason for the validation failure.","type":"string"},"rejectedValue":{"description":"This is a rejected input value."}},"type":"object"}}},"paths":{"/api-partner/v1/apps-in-toss/data-sdk/get-consented-user-data":{"post":{"description":"Check the user's consent status for consent-based user data items registered in the mini app. If the user has agreed to the latest consent details, return the actual data value; if they have not yet consented or have refused consent, return a URL that can take them to the consent screen instead of the data.\n\n### Business error code\n\nThe errors below return with HTTP 200 and `resultType: FAIL` response.\n\n| errorCode | Description                                    |\n| --------- | ---------------------------------------------- |\n| `4010`    | Authentication information could not be found. |","operationId":"getConsentedUserData","parameters":[{"description":"It's a key for authenticating users. [Get user information](https://developers-apps-in-toss.toss.im/documentation/api/toss-login#get-api-partner-v1-apps-in-toss-user-oauth2-login-me) You can obtain it through the API","in":"header","name":"x-toss-user-key","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSdkConsentedUserDataRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"discriminator":{"mapping":{"FAIL":"#/components/schemas/TossApiFail","SUCCESS":"#/components/schemas/TossApiSuccessDataSdkConsentedUserDataResponse"},"propertyName":"resultType"},"oneOf":[{"$ref":"#/components/schemas/TossApiSuccessDataSdkConsentedUserDataResponse"},{"$ref":"#/components/schemas/TossApiFail"}]}}},"description":"This is the result of processing the request. `resultType` Use the value to distinguish success/failure."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TossApiValidationFail"}}},"description":"The request body is not in the correct format. `error.data.errorDetails` Check the detailed information for each field below."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TossApiFail"}}},"description":"This is an uncategorized server error. If it keeps failing, contact the partner support channel."}},"summary":"View consent-based user data","tags":["sdk"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://developers-apps-in-toss.toss.im/api/en/sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
