> 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/documentation/api/sdk.md).

# 데이터 SDK

## 동의 기반 사용자 데이터 조회하기

> 미니앱에 등록된 동의 기반 사용자 데이터 항목의 사용자 동의 상태를 확인해요. 사용자가 최신 동의 내용에 동의했다면 실제 데이터 값을 반환하고, 아직 동의하지 않았거나 동의를 거부한 경우에는 데이터 대신 동의 화면으로 이동할 수 있는 URL을 반환해요.\
> \
> \### 비즈니스 오류 코드\
> \
> 아래 오류는 HTTP 200과 \`resultType: FAIL\`로 응답해요.\
> \
> \| errorCode | 설명 |\
> \| --- | --- |\
> \| \`4010\` | 인증 정보를 찾을 수 없어요. |

```json
{"openapi":"3.1.0","info":{"title":"Apps in Toss 파트너 API","version":"1.0.0"},"tags":[{"description":"파트너가 사용자의 동의를 받은 개인정보를 조회할 때 사용하는 API예요.","name":"sdk"}],"servers":[{"description":"운영 (간편 로그인·메시지 발송·토스 포인트 지급 등)","url":"https://apps-in-toss-api.toss.im"}],"security":[{"mutualTLS":[]}],"components":{"securitySchemes":{"mutualTLS":{"description":"파트너에게 발급된 클라이언트 인증서 기반 mTLS 인증이에요. 인증서의 CN으로 미니앱을 식별해요. 인증서 발급·관리 방법은 [서버 API 이용하기](https://appsintoss.gitbook.io/appsintoss-docs/gS3ttrb5Le6IDbEbyixR/documentation/integration/server-api) 문서를 참고하세요.","type":"mutualTLS"}},"schemas":{"DataSdkConsentedUserDataRequest":{"description":"동의 기반 사용자 데이터 조회 요청 본문이에요.","properties":{"consentedUserDataKey":{"description":"조회할 동의 기반 사용자 데이터 항목을 식별하는 키예요. 파트너 워크스페이스 콘솔에서 동의 기반 사용자 데이터 항목을 등록하면 발급돼요.","type":"string"}},"required":["consentedUserDataKey"]},"TossApiSuccessDataSdkConsentedUserDataResponse":{"description":"성공 응답 봉투예요.","properties":{"resultType":{"description":"처리 결과예요. 성공이면 `SUCCESS`예요.","enum":["SUCCESS"],"type":"string"},"success":{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"}},"required":["resultType","success"],"type":"object"},"DataSdkConsentedUserDataResponse":{"description":"동의 기반 사용자 데이터 조회 결과예요. `type` 값에 따라 실제로 내려오는 필드가 달라져요.","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":"응답 결과의 종류를 나타내는 판별자예요.","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":"동의한 데이터 항목의 실제 값이에요. 키는 데이터 항목(DataScopeKey), 값은 화면에 표시할 문자열이에요.","type":"object"}},"type":"object"}],"description":"사용자가 최신 동의 내용에 동의해서, 요청한 항목의 실제 데이터 값을 제공하는 응답이에요.","required":["data","type"]},"UserNotConsented":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"},{"properties":{"termsUrl":{"description":"사용자가 동의할 수 있는 동의 화면 URL이에요.","type":"string"}},"type":"object"}],"description":"사용자가 아직 동의 여부를 응답하지 않은 상태예요. `termsUrl`로 동의 화면을 안내해주세요.","required":["termsUrl","type"]},"UserDeclined":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"},{"properties":{"termsUrl":{"description":"사용자가 다시 동의할 수 있는 동의 화면 URL이에요.","type":"string"}},"type":"object"}],"description":"사용자가 동의를 명시적으로 거부한 상태예요. `termsUrl`로 동의 화면을 다시 안내할 수 있어요.","required":["termsUrl","type"]},"TermsNotSet":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"}],"description":"동의 화면에 노출할 약관 URL이 아직 설정되지 않아, 동의 여부를 안내할 수 없는 상태예요.","required":["type"]},"Unavailable":{"allOf":[{"$ref":"#/components/schemas/DataSdkConsentedUserDataResponse"}],"description":"일시적인 오류 등으로 사용자의 동의 상태를 확인할 수 없는 상태예요.","required":["type"]},"TossApiFail":{"description":"실패 응답 봉투예요. 비즈니스 오류는 HTTP 200으로 응답하니 `resultType`을 반드시 확인하세요.","properties":{"error":{"$ref":"#/components/schemas/TossApiError"},"resultType":{"description":"처리 결과예요. `SUCCESS`가 아닌 값은 모두 실패로 처리하세요. 일반적으로 `FAIL`이에요.","enum":["FAIL","HTTP_TIMEOUT","NETWORK_ERROR","EXECUTION_FAIL","INTERRUPTED","INTERNAL_ERROR"],"type":"string"},"success":{"description":"실패 시 항상 null이에요."}},"required":["error","resultType"],"type":"object"},"TossApiError":{"description":"오류 상세 정보예요.","properties":{"data":{"description":"오류 부가 정보예요. 요청 한도 초과 시 `retryAfterSeconds`가 담겨요.","type":"object"},"errorCode":{"description":"오류 코드예요. 각 API의 비즈니스 오류 코드 표를 참고하세요.","type":"string"},"errorType":{"description":"내부 오류 분류 값이에요. 오류 구분에는 `errorCode`를 사용하세요.","format":"int32","type":"integer"},"reason":{"description":"사람이 읽을 수 있는 오류 설명이에요.","type":"string"},"title":{"description":"오류 제목이에요. 대부분 null이에요.","type":"string"}},"required":["errorCode","reason"],"type":"object"},"TossApiValidationFail":{"description":"요청 필드 검증에 실패했을 때의 응답이에요.","properties":{"error":{"$ref":"#/components/schemas/TossApiValidationFailError"},"resultType":{"description":"처리 결과예요. `SUCCESS`가 아닌 값은 모두 실패로 처리하세요. 일반적으로 `FAIL`이에요.","enum":["FAIL","HTTP_TIMEOUT","NETWORK_ERROR","EXECUTION_FAIL","INTERRUPTED","INTERNAL_ERROR"],"type":"string"},"success":{"description":"실패 시 항상 null이에요."}},"required":["error","resultType"],"type":"object"},"TossApiValidationFailError":{"description":"오류 상세 정보예요.","properties":{"data":{"description":"오류 부가 정보예요. 요청 한도 초과 시 `retryAfterSeconds`가 담겨요.","properties":{"errorDetails":{"description":"필드별 검증 실패 상세 목록이에요.","items":{"$ref":"#/components/schemas/TossApiFieldError"},"type":"array"}},"type":"object"},"errorCode":{"description":"오류 코드예요. 각 API의 비즈니스 오류 코드 표를 참고하세요.","type":"string"},"errorType":{"description":"내부 오류 분류 값이에요. 오류 구분에는 `errorCode`를 사용하세요.","format":"int32","type":"integer"},"reason":{"description":"사람이 읽을 수 있는 오류 설명이에요.","type":"string"},"title":{"description":"오류 제목이에요. 대부분 null이에요.","type":"string"}},"required":["errorCode","reason"],"type":"object"},"TossApiFieldError":{"description":"필드별 검증 실패 상세 목록이에요.","properties":{"field":{"description":"검증에 실패한 필드 이름이에요.","type":"string"},"message":{"description":"검증 실패 사유예요.","type":"string"},"rejectedValue":{"description":"거부된 입력 값이에요."}},"type":"object"}}},"paths":{"/api-partner/v1/apps-in-toss/data-sdk/get-consented-user-data":{"post":{"description":"미니앱에 등록된 동의 기반 사용자 데이터 항목의 사용자 동의 상태를 확인해요. 사용자가 최신 동의 내용에 동의했다면 실제 데이터 값을 반환하고, 아직 동의하지 않았거나 동의를 거부한 경우에는 데이터 대신 동의 화면으로 이동할 수 있는 URL을 반환해요.\n\n### 비즈니스 오류 코드\n\n아래 오류는 HTTP 200과 `resultType: FAIL`로 응답해요.\n\n| errorCode | 설명 |\n| --- | --- |\n| `4010` | 인증 정보를 찾을 수 없어요. |","operationId":"getConsentedUserData","parameters":[{"description":"사용자를 인증하기 위한 키예요. [사용자 정보 받기](https://appsintoss.gitbook.io/appsintoss-docs/gS3ttrb5Le6IDbEbyixR/documentation/api/toss-login#get-api-partner-v1-apps-in-toss-user-oauth2-login-me) 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":"요청 처리 결과예요. `resultType` 값으로 성공/실패를 구분하세요."},"400":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TossApiValidationFail"}}},"description":"요청 본문이 형식에 맞지 않아요. `error.data.errorDetails`에서 필드별 상세를 확인하세요."},"500":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TossApiFail"}}},"description":"분류되지 않은 서버 오류예요. 계속 실패하면 파트너 지원 채널로 문의해 주세요."}},"summary":"동의 기반 사용자 데이터 조회하기","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/documentation/api/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.
