사이드 메뉴
Getting started
Kakao Developers
Login
Communication
Advertisement
- Concepts
- Ad creation: Ad account
- Ad creation: Campaign
- Ad creation: Ad group
- Targeting for ad group
- Custom audience targeting for ad group
- Ad creation: Creative common
- Ad creation: Display creative
- Ad creation: Message creative
- Ad creation: Personalized message creative
- Bizboard landing settings
- Report
- Message management
- Personalized message management
- Message ad management
- Message ad operation
- Ad View management
- Business Form+ management
- Business Form linkage management
- Pixel & SDK linkage management
- Audience management
- Engagement targeting management
- Customer file management
- Friend group management
- Ad account management
- Reference
- Type information
- Error code
Webhook
This document introduces webhook system for Kakao Login.
Webhook is a feature that sends an HTTP request to the webhook URL set in Kakao Developer to share with the service when there is a change in the account status of a Kakao Login user.
The webhook system is designed based on the Shared Signals and Events Framework(SSF) developed by the OpenID Foundation, with additional event types specifically defined by Kakao.
This document explains the webhook requests that Kakao sends to your service's endpoint. Note that this specification describes incoming webhook requests from Kakao, not API requests that your service makes to Kakao.
For the overall workflow and detailed implementation guide for webhooks, see Implementation steps.
| Method | URL | Required response | Authorization |
|---|---|---|---|
GET/POST | Webhook URL registered in [App] > [Webhook] on the app management page | HTTP status code 200 OK (within 3 seconds) | Primary admin key |
The unlink webhook is a feature where Kakao notifies the service when a user disconnects the app outside the service.
Upon receiving the webhook, the service must process the user's information according to its internal policy and respond with an HTTP status code 200 OK within 3 seconds.
Users who request to unlink outside the service will see a message that the service is no longer available. The unlink webhook is sent after completing the unlink process for the user.
The webhook includes the Service app admin key in the header, and app ID (app_id), user ID (user_id), unlink request source (referrer_type) in the body.
The unlink webhook requires specifying a webhook URL and method, and redirection is not supported. For configuration details, refer to Set unlink webhook.
Unlink webhooks are sent under the following conditions. However, if the service calls the Unlink API to disconnect the app from the user, the unlink webhook will not be sent.
- Unlinking users who have not completed registration.
- When a user disconnects the app via the Kakao Account management page or the Unlink on Manage connected services menu in Kakao Talk.
- When the user deletes their Kakao Account.
- When the app is unlinked due to a customer service request.
The service must respond according to the specified format after perform the necessary tasks upon receiving a webhook. Refer to the steps below.
- Verify the received webhook using the included Service app admin key and
app_id. - If the webhook is valid, process the user information corresponding to
user_idin the database (DB) by performing deletion, removal, or other actions in accordance with the privacy policy and service policy. - Respond with an HTTP status code
200 OKwithin 3 seconds of receiving the webhook.- No body content is required because the success of the response is determined by the HTTP status code.
- Even if user information processing fails or the user cannot be found, respond with an HTTP status code
200 OK. Perform any additional necessary tasks internally within the service afterward.
To receive an unlink webhook, simulate a scenario where the user disconnects the app. The unlink feature is available on the Kakao Account page or in Kakao Talk via [More] > [Settings] > [Kakao Account]. Use this feature to verify whether the service server processes unlink webhooks correctly.
| Name | Type | Description | Required |
|---|---|---|---|
| Authorization | String | Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}The Admin key as a type of user authentication. | O |
| Name | Type | Description | Required |
|---|---|---|---|
| app_id | String | App ID that a user requests to unlink from. | O |
| user_id | String | Service user ID of a user who requests to unlink. | O |
| referrer_type | String | The route of a user requests to unlink. One of the followings:
| O |
| group_user_token | String | Group user token of the user who requested to unlink, provided only when the unlink occurs in a group app | X |
You must respond with HTTP status code 200 OK within 3 seconds of receiving the webhook request.
Theses are examples of the webhook request that Kakao sends to your service when a user unlinks outside of the service.
Request: GET method
curl -v -G GET "{UNLINK_CALLBACK_URL}?app_id=123456&user_id=1234567890&referrer_type=UNLINK_FROM_APPS" \-H "Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}"
Request: POST method
curl -v -X POST "{UNLINK_CALLBACK_URL}" \-H "Authorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}" \--data-urlencode "app_id=123456" \--data-urlencode "user_id=1234567890" \--data-urlencode "referrer_type=UNLINK_FROM_APPS"
Response
This is an example of the response your service endpoint should send to Kakao.
HTTP/1.1 200 OK
| Method | URL | Required response format | Authorization |
|---|---|---|---|
POST | Webhook URL registered in [My Applications] > [Kakao Login] > [Account Status Change Webhook] | Respond within 3 seconds based on the SET verification results:
| Primary REST API key |
| Permission | Prerequisite | Kakao Login | User consent |
|---|---|---|---|
| - | REST API key Activate Kakao Login Account status change webhook | Required | Required to use the events in CAEP, RISC category. |
The account status change webhook sends event information to the specified webhook URL whenever a user's account status changes.
For implementation steps, refer to Implementation steps.
Your service must respond to webhook requests with either a success or a validation failure response as specified. If no response is received or the response does not comply with the validation failure format, Kakao considers the event delivery as failed and attempts a retry. Continuous delivery failures may result in webhook deactivation.
The supported events by category are listed below. Select an event name in the [Event type] column to view the event payload in the event details.
| Category | Description | Event type |
|---|---|---|
| OAUTH |
| Tokens Revoked User Linked User Unlinked User Scope Consent User Scope Withdraw Business Token Issued Business Token Revoked Business Tokens Revoked |
| RISC |
Important: Scope configuration and user consent are required. | Account Credential Change Required Account Disabled Account Enabled Account Purged Credential Compromise Identifier Changed Identifier Recycled Sessions Revoked |
| CAEP |
Important: Scope configuration and user consent are required. | Assurance Level Change Credential Change |
| KAKAO |
| User Profile Changed |
Change events under the CAEP and RISC categories may include sensitive information. Thus, these require configuring the [Kakao Account status change details] consent item and obtaining user consent.
If necessary, follow the steps below:
- Request for permission to set the consent level for the [Kakao Account status change history] consent item through DevTalk.
- This permission is granted after a suitability review, so a specific usage scenario must be included when making a request.
- Once granted, set [Kakao Account status change details] as [Optional Consent] in [Kakao Login] > [Consent Items] on the app management page. Refer to Prerequisites.
CAEP and RISC category event information is provided only when the user has agreed to the [Kakao Account status change details] consent item. Services that are required to receive this information must set the [Kakao Account status change details] consent item to the [required consent] consent level.
- Triggering timing: All tokens issued to a user via Kakao Login expire.
- Required action: Terminate all active service sessions to protect the user account.
- Schema:
https://schemas.openid.net/secevent/oauth/event-type/tokens-revoked
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
| reason | String | Entity that revoked the tokens.
|
- Triggering timing: User links to an app.
- Recommended action: For apps with [Auto-link with an app when logging in] set to [Disabled], complete user registration and perform any other actions required by the service.
- Schema:
https://schemas.openid.net/secevent/oauth/event-type/user-linked
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
- Triggering timing: User unlinks from an app.
- Recommended action: Unlink Kakao Login from the user's account, or delete the user account if Kakao Login is the only authentication method. (Refer to Unlink webhook)
- Schema:
https://schemas.openid.net/secevent/oauth/event-type/user-unlinked
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
| reason | String | Route through which the user unlinked, one of the following:
|
- Triggering timing: User consents to a scope via Kakao Login.
- Schema:
https://schemas.openid.net/secevent/oauth/event-type/user-scope-consent
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
| scope | String | Consent items the user agreed to. A single string containing the ID of each consent item, separated by spaces. (Example: account_email birthday age_range) |
- Triggering timing: User withdraws consent for a scope.
- Schema:
https://schemas.openid.net/secevent/oauth/event-type/user-scope-withdraw
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
| scope | String | Consent items the user withdrew. A single string containing the ID of each consent item, separated by spaces. (Example: account_email birthday age_range) |
- Triggering timing: A new business token is issued through Business authentication.
- Recommended action: Store and manage the issued business token information.
- Schema:
https://schemas.openid.net/secevent/oauth/event-type/token-issued
Event payload
See the table below and Payload sample.
| Name | Type | Description |
|---|---|---|
| subject | BizTokenSubject | Business token information for issuance. |
| token_subject | TokenOwnerSubject | Token owner information. |
| token_id | String | Business token ID. |
| token_class | String | Token class, fixed to business. |
| Field | Type | Description |
|---|---|---|
subject_type | String | Fixed to oauth_token. |
token_type | String | Fixed to business_access_token. |
token_identifier_alg | String | Token hash algorithm, fixed to hash_sha256. |
token | String | Hashed token value in base64url(sha256(token value)) format. |
| Field | Type | Description |
|---|---|---|
subject_type | String | Fixed to iss-sub. |
iss | String | Fixed to https://kauth.kakao.com/. |
sub | String | User's Business authentication user ID. |
Below are SET payload examples for business token events.
{"events": {"https://schemas.openid.net/secevent/oauth/event-type/token-issued": {"subject": {"subject_type": "oauth_token","token_type": "access_token","token_identifier_alg": "hash_sha256","token": "base64url(sha256(${TOKEN_VALUE}))"},"token_subject": {"subject_type": "iss-sub","iss": "https://kauth.kakao.com/","sub": "${TOKEN_USER_ID}"},"token_id": "${TOKEN_ID}","token_class": "business"}}}
- Triggering timing: Business token issued through Business authentication is revoked.
- Required action: Stop API calls using the business token.
- Schema:
https://schemas.openid.net/secevent/oauth/event-type/token-revoked
Event payload
See the table below and Payload sample.
| Name | Type | Description |
|---|---|---|
| subject | BizTokenSubject | Business token information for revocation. |
| token_subject | TokenOwnerSubject | Token owner information. |
| token_id | String | Business token ID. |
| token_class | String | Token class, fixed to business. |
- Triggering timing: All business tokens issued to a user are revoked.
- Required action: Stop using all business tokens for the user.
- Schema:
https://schemas.openid.net/secevent/oauth/event-type/tokens-revoked
Event payload
See the table below and Payload sample.
| Name | Type | Description |
|---|---|---|
| subject | TokenOwnerSubject | User whose tokens were revoked. |
| token_class | String | Token class, fixed to business. |
RISC category events require Scope configuration and user consent.
- Triggering timing: Account password is changed.
- Recommended action: Review suspicious activities and decide on necessary follow-up actions.
- Schema:
https://schemas.openid.net/secevent/risc/event-type/account-credential-change-required
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
- Triggering timing: Account is disabled for Kakao Account protection, lock, or usage restriction.
- Required action: If the reason is
hijacking, terminate all active sessions to protect the user account. If the reason isbulk-account, analyze user activity and determine necessary follow-up actions. - Schema:
https://schemas.openid.net/secevent/risc/event-type/account-disabled
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
| reason | String | Reason for Kakao Account disablement. |
- Triggering timing: Account is enabled. When a Kakao Account is recovered from dormant or hijacked state.
- Recommended action: Re-enable account recovery via Kakao Login and registered Kakao Account email.
- Schema:
https://schemas.openid.net/secevent/risc/event-type/account-enabled
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
- Triggering timing: Account is deleted.
- Recommended action: Delete the user account or provide alternative login methods.
- Schema:
https://schemas.openid.net/secevent/risc/event-type/account-purged
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
- Triggering timing: Credential compromise is detected. When Kakao Account credentials are suspected of being compromised. (Example: successful login from a suspicious new environment)
- Recommended action: Review suspicious activities and decide on necessary follow-up actions.
- Schema:
https://schemas.openid.net/secevent/risc/event-type/credential-compromise
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
- Triggering timing: Identifier is changed. When the user's email address or phone number is updated.
- Recommended action: Delete the old phone number or email address, and update the records with the new identifier.
- Schema:
https://schemas.openid.net/secevent/risc/event-type/identifier-changed
Event payload
| Name | Type | Description |
|---|---|---|
| subject | IdentiferSubject | Identifier before the change. |
| new_value | String | Updated phone number or email. |
| Name | Type | Description |
|---|---|---|
subject_type | String | phone or email. |
phone_number | String | Previous phone number when the phone number was changed or disabled. |
account_email | String | Previous email when the email was changed or disabled. |
- Triggering timing: Identifier is no longer available. When a Kakao Account's email or phone number is reused by another user, causing the previous identifier to expire (Expired) or be suspended (Suspended).
- Recommended action: Stop using the user's email and phone number in the service, and directly collect new email and phone number information from the user.
- Schema:
https://schemas.openid.net/secevent/risc/event-type/identifier-recycled
Event payload
| Name | Type | Description |
|---|---|---|
| subject | IdentiferSubject | Identifier that is no longer available. |
| new_value | String | Phone number or email that is no longer available. |
- Triggering timing: All sessions are terminated. When existing devices are logged out after a password change.
- Required action: Terminate all active sessions to protect the user account.
- Schema:
https://schemas.openid.net/secevent/risc/event-type/sessions-revoked
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
CAEP category events require Scope configuration and user consent.
- Triggering timing: Authentication security level is changed. When security level changes such as two-factor authentication setup.
- Recommended action: Verify the user meets the authentication security level required for the service, and re-authenticate if necessary before providing the service.
- Schema:
https://schemas.openid.net/secevent/caep/event-type/assurance-level-change
Event payload
| Name | Type | Description |
|---|---|---|
| current_level | String | Kakao Account authentication level.
|
| previous_level | String | Previous Kakao Account authentication level.
|
| change_direction | String | Kakao Account authentication level change.
|
- Triggering timing: Account password is changed. When a password is reset or a Kakao certificate is reissued.
- Schema:
https://schemas.openid.net/secevent/caep/event-type/credential-change
Event payload
| Name | Type | Description |
|---|---|---|
| subject | Subject | Target user of the event. |
| change_type | String | Account password change type.
|
- Triggering timing: User Kakao Account information is changed. Notified only when information the user consented to provide is changed.
- Recommended action: Call the Retrieve user information API and update with the changed information.
- Schema:
https://schemas.kakao.com/platevent/kakao/event-type/user-profile-changed
Event payload
| Name | Type | Description |
|---|---|---|
| profile | String | Profile information changed by the user. A single string containing the ID of each consent item, separated by spaces. Only the types of changed information are sent, not the changed values. (Example: account_email birthday age_range) |
The service receives a SET (Security Event Token) containing change event information of the Kakao Account through the POST method.
Below is an example of the request that is delivered to the webhook URL. Content-Type of the webhook request header is application/secevent+jwt, and the body is a SET value containing the change event information. SET is a JWT (JSON Web Token) type token and consists of the three parts.
POST /kakao/events HTTP/1.1Host: callback.example.comContent-Type: application/secevent+jwtAccept: application/jsoneyJraWQiOiI2NjVhYmVlYzExOGRkZmMyZDNiZjNlMmFkYWU3OT...
The SET is generated as a single string of three parts that are Base64-encoded and concatenated with the period (.). The contents can be verified by Base64-decoding after separating each part based on the period. After SET validation, the service can verify the payload contents to perform any necessary user account protection actions. Below is an example of a decoded SET header and payload.
{"kid": "665abeec118ddfc2d3bf3e2adae799","typ": "secevent+jwt","alg": "RS256"}
| Category | Description |
|---|---|
| Header | SET specification. |
| Payload | Change event information. |
| Signature | A value signed by the Kakao Authentication Server (KAUTH) with the public key corresponding to kid in the header. |
Below are the details of the fields in the Header and Payload.
| Name | Type | Description | Required |
|---|---|---|---|
| alg | String | The encryption applied to the SET, fixed to RS256. | O |
| typ | String | Type of SET, fixed to secevent+jwt. | O |
| kid | String | Public key ID used to encrypt the SET. Can be found through jwks_uri of Get metadata. | O |
| Name | Type | Description |
|---|---|---|
| aud | String | The REST API key of the app receiving the SET. |
| sub | String | Service user ID corresponding to the SET. |
| iss | String | SET issuer. Fixed to https://kauth.kakao.com. |
| txm | String | Unique identifier for the webhook event request. |
| toe | Integer | Event occurrence time in Unix timestamp format (unit: seconds). |
| iat | Integer | SET issuance time in Unix timestamp format (unit: seconds). |
| jti | String | SET unique identification value. |
| events | Event | Change event types and details. |
| Name | Type | Description |
|---|---|---|
${SCHEMA} | JSON | Details by change event type. The key is Schema by Change event type.The value is different for each change event type. See Event details for more information. |
| Name | Type | Description |
|---|---|---|
| subject_type | String | User identifier type.
|
| iss | String | SET issuer. Fixed to https://kauth.kakao.com.Note: Not included in Identifier Changed and Identifier Recycled event information. |
| sub | String | Service user ID corresponding to the SET. Note: Not included in Identifier Changed and Identifier Recycled event information. |
The service must check and validate the contents of the SET before performing user account protection actions based on change event information. You can check and verify the SET contents in the following order:
- Separate the header, payload, and signature based on the period (.).
- Decode the payload in Base64.
- Verify that the
issvalue in the payload matcheshttps://kauth.kakao.com. - Verify that the
audvalue in the payload matches the service app's REST API key. - Verify the signature
Signature verification proceeds in the following order.
- Decode the header in Base64.
- Request OIDC: Get public key to get the list of public keys used by the Kakao authentication server for signing.
- Check the public key value corresponding to the
kidof the header in the public key list.- Caching the public key for a certain period is recommended, and note that requests may be blocked if they are too frequent.
- Verify the signature with the public key using a library that supports JWT signature verification.
- Note: OpenID Foundation, jwt.io
- When implementing signature verification directly without using a library, the signature verification process can be performed according to the RFC7515 specification.
If the SET receiving server receives a webhook request via the webhook URL and the SET validation is successful, you should respond with the HTTP response code 202 Accepted with no response body. See the example below.
HTTP/1.1 202 Accepted
If the SET receiving server fails to validate the SET after receiving the webhook, you must respond within 3 seconds using the following format:
- HTTP status code:
400 Bad Request - Header:
Content-Type:application/json - Body: In JSON format, including the error code (
err) and reason (description) as specified in the RFC8935 standard.
// HTTP/1.1 400 Bad Request// Content-Type: application/json{"err": "invalid_key","description": "Key ID 12345 has been revoked."}
| Error Code | Description |
|---|---|
| invalid_request | When the delivered SET does not comply with the JWT specification. |
| invalid_key | When failed to decrypt the delivered SET with Kakao's public key. |
| invalid_issuer | If the issuer of the delivered SET is not Kakao. |
| invalid_audience | If the aud value of the delivered SET does not match the service app ID. |
| Method | URL | Authorization |
|---|---|---|
GET | https://kauth.kakao.com/.well-known/ssf-configuration | - |
You can retrieve the Account status change webhook specification.
| Name | Type | Description | Required |
|---|---|---|---|
| issuer | String | SET issuer. Fixed to https://kauth.kakao.com. | O |
| jwks_uri | String | The URI to retrieve the public key used for SET encryption. A public key is required for SET verification. | O |
| delivery_methods_supported | String | Supported SSE event delivery methods. Only push is supported. | O |
Request
curl -X GET https://kauth.kakao.com/.well-known/ssf-configuration
Response
// HTTP/1.1 200{"issuer": "https://kauth.kakao.com","jwks_uri": "https://kauth.kakao.com/.well-known/jwks.json","delivery_methods_supported": "http://schemas.openid.net/secevent/risc/delivery-method/push"}
You can try sending webhooks to see if webhooks work normally in [Tools] > [Webhook Test]. See Account status change webhook test for more details.