Skip to main content
curl --request POST 'https://api.mayar.id/hl/v2/name-services/update' \
--header 'Authorization: Bearer Paste-Your-API-Key-Here' \
--data-raw '{
    "id": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
    "name": "Premium Newsletter",
    "description": "Monthly premium newsletter access",
    "website": "https://testingmayar.myr.id",
    "amount": 75000,
    "urlHook": "https://webhook.example.com/name-service",
    "image": "https://media.mayar.id/images/b2c3d4e5-f6a7-489a-b012-3456789abcde.png",
    "payload": {
        "plan": "premium",
        "durationInDays": 30
    },
    "credential": {
        "apiKey": "service-credential-value"
    },
    "event": {
        "type": "subscription.renewed"
    }
}'
{
    "statusCode": 200,
    "messages": "success",
    "data": {
        "id": "a1b2c3d4-e5f6-4789-a012-3456789abcde",
        "userId": "348e083d-315a-4e5c-96b1-5a2a98c48413",
        "name": "Premium Newsletter",
        "slug": "premium-newsletter",
        "description": "Monthly premium newsletter access",
        "website": "https://testingmayar.myr.id",
        "amount": 75000,
        "urlHook": "https://webhook.example.com/name-service",
        "image": "https://media.mayar.id/images/b2c3d4e5-f6a7-489a-b012-3456789abcde.png",
        "payload": "{\"plan\":\"premium\",\"durationInDays\":30}",
        "credential": "{\"apiKey\":\"service-credential-value\"}",
        "event": "{\"type\":\"subscription.renewed\"}"
    }
}
Endpoint:
https://api.mayar.id/hl/v2/name-services/update

Authorization

Authorization
string
required
Example:Authorization | Bearer Paste-Your-API-Key-Here
The service id is read from the request body, not the URL. Provide the id of the service you own in the JSON body to identify the record to update.

Request Body

id
string<uuid>
required
ID of the name service to update. Must be a valid UUID for a service you own.
name
string
Updated name of the service.
description
string
Updated description of the service.
payload
object
Updated configuration object for the service. Stored as serialized JSON.
credential
object
Credential object for the service. Stored as serialized JSON when provided.
urlHook
string
Updated webhook URL notified for events related to this service.
amount
number | integer
Updated price (in IDR) associated with the service.
website
string
Updated public website URL associated with the service.
image
string
Updated image URL representing the service.
event
object
Event configuration for the service. Stored as serialized JSON.

Response

Successful Response

Main Structure (Root)

statusCode
integer
Status code returned by the API.
messages
string
Status message that describes the status code.
data
object
The updated name service record.

data Structure (Object)

id
string<uuid>
Service ID.
userId
string<uuid>
ID of the account that owns the service.
name
string
Service name.
slug
string
URL-friendly slug derived from the service name.
description
string
Service description.
website
string
Public website URL associated with the service.
amount
number
Price (in IDR) associated with the service.
urlHook
string
Webhook URL notified for events related to this service.
image
string
Image URL representing the service.
payload
string
Service configuration as a serialized JSON string.
credential
string
Service credential as a serialized JSON string.
event
string
Event configuration as a serialized JSON string.

Errors

500 Server Error
object
Returned with messages set to the error description when the service cannot be updated (for example, when id is missing or does not match a service you own).