본문 바로가기메인 메뉴 바로가기사이드 메뉴 바로가기

kakao developers

Related sites
  • Docs
  • Kakao Login
  • Webhook

사이드 메뉴

Kakao Map

Search

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.

MethodURLRequired responseAuthorization
GET/POSTWebhook URL registered in [App] > [Webhook] on the app management pageHTTP 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.

The service must respond according to the specified format after perform the necessary tasks upon receiving a webhook. Refer to the steps below.

  1. Verify the received webhook using the included Service app admin key and app_id.
  2. If the webhook is valid, process the user information corresponding to user_id in the database (DB) by performing deletion, removal, or other actions in accordance with the privacy policy and service policy.
  3. Respond with an HTTP status code 200 OK within 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.

NameTypeDescriptionRequired
AuthorizationStringAuthorization: KakaoAK ${SERVICE_APP_ADMIN_KEY}
The Admin key as a type of user authentication.
O
NameTypeDescriptionRequired
app_idStringApp ID that a user requests to unlink from.O
user_idStringService user ID of a user who requests to unlink.O
referrer_typeStringThe route of a user requests to unlink.

One of the followings:
  • ACCOUNT_DELETE: If a user deletes the Kakao Account.
  • FORCED_ACCOUNT_DELETE: If a user's Kakao Account is deleted through Customer Service or deleted after a four-year dormant state.
  • UNLINK_FROM_APPS: If a user selects [Disconnect] on 'Manage Connected Services'.
  • UNLINK_FROM_ADMIN: If a user requests to unlink through the Kakao Customer service.
  • INCOMPLETE_SIGN_UP: If a user has not completed a signup. (Refer to Notice)
O
group_user_tokenStringGroup user token of the user who requested to unlink, provided only when the unlink occurs in a group appX

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.

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}"
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"

This is an example of the response your service endpoint should send to Kakao.

HTTP/1.1 200 OK
MethodURLRequired response formatAuthorization
POSTWebhook URL registered in [My Applications] > [Kakao Login] > [Account Status Change Webhook]Respond within 3 seconds based on the SET verification results:
  • Success: HTTP status code 202 Accepted
  • Failure: HTTP status code 400 Bad Request with specified header and body (Reference)
Primary REST API key

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.

Caution

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.

CategoryDescriptionEvent type
OAUTH
  • Change event types related to the OAuth 2.0 protocol.
  • Based on the OpenID Foundation's OAUTH specification.
  • Webhooks are sent when Kakao Login users link or unlink an app, consent to or withdraw consent for scopes, or when business tokens are issued or revoked.
Tokens Revoked
User Linked
User Unlinked
User Scope Consent
User Scope Withdraw
Business Token Issued
Business Token Revoked
Business Tokens Revoked
RISC
  • Security event types related to anomalies in user Kakao Accounts.
  • Based on the OpenID Foundation's RISC (Risk Incident Sharing and Coordination) specification.
  • Webhooks are sent for abnormal account activities or suspected account hijacking attempts.

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
  • Security event types related to credentials (tokens) and access rights issued to user Kakao Accounts.
  • Based on the OpenID Foundation's CAEP (Continuous Access Evaluation Protocol) specification.
  • Webhooks are sent when the authentication security level changes or the password is updated.

Important: Scope configuration and user consent are required.
Assurance Level Change
Credential Change
KAKAO
  • Event types triggered by changes in user Kakao Account status information.
  • Specification defined and provided by Kakao.
  • Webhooks are sent when profile information such as email or birthday is updated.
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:

  1. 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.
  2. Once granted, set [Kakao Account status change details] as [Optional Consent] in [Kakao Login] > [Consent Items] on the app management page. Refer to Prerequisites.
Provided only when the user has agreed

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.

NameTypeDescription
subjectSubjectTarget user of the event.
reasonStringEntity that revoked the tokens.
  • issuer: Issuer.
  • user: User.
  • 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
NameTypeDescription
subjectSubjectTarget 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
NameTypeDescription
subjectSubjectTarget user of the event.
reasonStringRoute through which the user unlinked, one of the following:
  • ACCOUNT_DELETE: Kakao Account deletion.
  • FORCED_ACCOUNT_DELETE: Forced Kakao Account deletion due to long-term dormancy or Customer Service.
  • INCOMPLETE_SIGN_UP: Deletion of a user who has not completed signup.
  • UNLINK_FROM_ADMIN: Unlink processed by Kakao administrator.
  • UNLINK_FROM_APPS: Service unlink from the Kakao Account page.
  • REVOKE_ACCOUNT_SERVICE_TERMS: Revocation of integrated service terms consent.
  • UNLINK_FROM_SERVICE: Service withdrawal.
  • Triggering timing: User consents to a scope via Kakao Login.
  • Schema: https://schemas.openid.net/secevent/oauth/event-type/user-scope-consent
NameTypeDescription
subjectSubjectTarget user of the event.
scopeStringConsent 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
NameTypeDescription
subjectSubjectTarget user of the event.
scopeStringConsent items the user withdrew.
A single string containing the ID of each consent item, separated by spaces.
(Example: account_email birthday age_range)

See the table below and Payload sample.

NameTypeDescription
subjectBizTokenSubjectBusiness token information for issuance.
token_subjectTokenOwnerSubjectToken owner information.
token_idStringBusiness token ID.
token_classStringToken class, fixed to business.
FieldTypeDescription
subject_typeStringFixed to oauth_token.
token_typeStringFixed to business_access_token.
token_identifier_algStringToken hash algorithm, fixed to hash_sha256.
tokenStringHashed token value in base64url(sha256(token value)) format.
FieldTypeDescription
subject_typeStringFixed to iss-sub.
issStringFixed to https://kauth.kakao.com/.
subStringUser'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"
}
}
}

See the table below and Payload sample.

NameTypeDescription
subjectBizTokenSubjectBusiness token information for revocation.
token_subjectTokenOwnerSubjectToken owner information.
token_idStringBusiness token ID.
token_classStringToken class, fixed to business.

See the table below and Payload sample.

NameTypeDescription
subjectTokenOwnerSubjectUser whose tokens were revoked.
token_classStringToken class, fixed to business.

RISC category events require Scope configuration and user consent.

NameTypeDescription
subjectSubjectTarget 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 is bulk-account, analyze user activity and determine necessary follow-up actions.
  • Schema: https://schemas.openid.net/secevent/risc/event-type/account-disabled
NameTypeDescription
subjectSubjectTarget user of the event.
reasonStringReason for Kakao Account disablement.
NameTypeDescription
subjectSubjectTarget user of the event.
NameTypeDescription
subjectSubjectTarget user of the event.
NameTypeDescription
subjectSubjectTarget user of the event.
NameTypeDescription
subjectIdentiferSubjectIdentifier before the change.
new_valueStringUpdated phone number or email.
NameTypeDescription
subject_typeStringphone or email.
phone_numberStringPrevious phone number when the phone number was changed or disabled.
account_emailStringPrevious 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
NameTypeDescription
subjectIdentiferSubjectIdentifier that is no longer available.
new_valueStringPhone number or email that is no longer available.
NameTypeDescription
subjectSubjectTarget 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
NameTypeDescription
current_levelStringKakao Account authentication level.
  • nist-aal1: Two-factor authentication not set.
  • nist-aal2: Two-factor authentication set.
previous_levelStringPrevious Kakao Account authentication level.
  • nist-aal1: Two-factor authentication not set.
  • nist-aal2: Two-factor authentication set.
change_directionStringKakao Account authentication level change.
  • increase: Authentication level increased.
  • decrease: Authentication level decreased.
NameTypeDescription
subjectSubjectTarget user of the event.
change_typeStringAccount password change type.
  • update: Password change or Kakao certificate reissue.
  • 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
NameTypeDescription
profileStringProfile 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.1
Host: callback.example.com
Content-Type: application/secevent+jwt
Accept: application/json
eyJraWQiOiI2NjVhYmVlYzExOGRkZmMyZDNiZjNlMmFkYWU3OT...

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"
}
CategoryDescription
HeaderSET specification.
PayloadChange event information.
SignatureA 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.

NameTypeDescriptionRequired
algStringThe encryption applied to the SET, fixed to RS256.O
typStringType of SET, fixed to secevent+jwt.O
kidStringPublic key ID used to encrypt the SET.
Can be found through jwks_uri of Get metadata.
O
NameTypeDescription
audStringThe REST API key of the app receiving the SET.
subStringService user ID corresponding to the SET.
issStringSET issuer. Fixed to https://kauth.kakao.com.
txmStringUnique identifier for the webhook event request.
toeIntegerEvent occurrence time in Unix timestamp format (unit: seconds).
iatIntegerSET issuance time in Unix timestamp format (unit: seconds).
jtiStringSET unique identification value.
eventsEventChange event types and details.
NameTypeDescription
${SCHEMA}JSONDetails 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.
NameTypeDescription
subject_typeStringUser identifier type.
  • iss-sub: Service user ID.
  • phone: Phone number.
  • account_email: Email.
issStringSET issuer.
Fixed to https://kauth.kakao.com.

Note: Not included in Identifier Changed and Identifier Recycled event information.
subStringService 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:

  1. Separate the header, payload, and signature based on the period (.).
  2. Decode the payload in Base64.
  3. Verify that the iss value in the payload matches https://kauth.kakao.com.
  4. Verify that the aud value in the payload matches the service app's REST API key.
  5. Verify the signature

Signature verification proceeds in the following order.

  1. Decode the header in Base64.
  2. Request OIDC: Get public key to get the list of public keys used by the Kakao authentication server for signing.
  3. Check the public key value corresponding to the kid of 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.
  4. 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 CodeDescription
invalid_requestWhen the delivered SET does not comply with the JWT specification.
invalid_keyWhen failed to decrypt the delivered SET with Kakao's public key.
invalid_issuerIf the issuer of the delivered SET is not Kakao.
invalid_audienceIf the aud value of the delivered SET does not match the service app ID.
MethodURLAuthorization
GEThttps://kauth.kakao.com/.well-known/ssf-configuration-

You can retrieve the Account status change webhook specification.

NameTypeDescriptionRequired
issuerStringSET issuer.
Fixed to https://kauth.kakao.com.
O
jwks_uriStringThe URI to retrieve the public key used for SET encryption.
A public key is required for SET verification.
O
delivery_methods_supportedStringSupported SSE event delivery methods.
Only push is supported.
O
curl -X GET https://kauth.kakao.com/.well-known/ssf-configuration
// 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.

Was this helpful?