{"openapi":"3.0.0","info":{"version":"1.0.0","title":"Enoki API Specification","description":"HTTP API for Enoki"},"servers":[{"url":"http://api.enoki.mystenlabs.com","description":"Current environment"}],"components":{"securitySchemes":{"apiKey":{"type":"http","scheme":"bearer","bearerFormat":"Enoki API Key"}},"schemas":{"Nonce Response":{"type":"object","properties":{"data":{"type":"object","properties":{"nonce":{"type":"string"},"randomness":{"type":"string"},"epoch":{"type":"number"},"maxEpoch":{"type":"number"},"estimatedExpiration":{"type":"number"}},"required":["nonce","randomness","epoch","maxEpoch","estimatedExpiration"]}},"required":["data"]},"Nonce Request":{"type":"object","properties":{"network":{"type":"string","enum":["testnet","mainnet","devnet"],"default":"mainnet","description":"The Sui network you wish to use. Defaults to `mainnet`."},"ephemeralPublicKey":{"type":"string","description":"The ephemeral public key created during the zkLogin process, encoded as a base64 string."},"additionalEpochs":{"type":"number","maximum":30,"minimum":0,"default":2,"description":"The amount of epochs that you would like to have the nonce be valid for."}},"required":["ephemeralPublicKey"]},"ZKP Response":{"type":"object","properties":{"data":{"type":"object","properties":{"proofPoints":{"nullable":true},"issBase64Details":{"nullable":true},"headerBase64":{"nullable":true},"addressSeed":{"type":"string"}},"required":["addressSeed"]}},"required":["data"]},"ZKP Request":{"type":"object","properties":{"network":{"type":"string","enum":["testnet","mainnet","devnet"],"default":"mainnet","description":"The Sui network you wish to use. Defaults to `mainnet`."},"ephemeralPublicKey":{"type":"string","description":"The ephemeral public key created during the zkLogin process, encoded as a base64 string."},"maxEpoch":{"type":"integer","minimum":0,"description":"The `maxEpoch` created during the zkLogin process."},"randomness":{"type":"string","description":"The `randomness` created during the zkLogin process."}},"required":["ephemeralPublicKey","maxEpoch","randomness"]},"CreateSponsoredTransactionResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"digest":{"type":"string"},"bytes":{"type":"string"}},"required":["digest","bytes"]}},"required":["data"]},"CreateSponsoredTransactionRequest":{"type":"object","properties":{"network":{"type":"string","enum":["testnet","mainnet","devnet"],"default":"mainnet","description":"The Sui network you wish to use. Defaults to `mainnet`."},"transactionBlockKindBytes":{"type":"string","description":"Bytes of the transaction with the `onlyTransactionKind` flag set to true."},"sender":{"type":"string","description":"The address sending the transaction. Include this parameter if not including the `zklogin-jwt` header. This option is only supported when calling the API from a backend service using a private key."},"allowedAddresses":{"type":"array","items":{"type":"string"},"description":"List of Sui addresses that can be present in the transaction. These addresses are combined with the list configured in the Enoki Developer Portal. Transactions attempting to refer to or transfer assets outside of these addresses are rejected."},"allowedMoveCallTargets":{"type":"array","items":{"type":"string"},"description":"List of permitted Move targets the sponsored user's transactions can call."}},"required":["transactionBlockKindBytes"]},"ExecuteSponsoredTransactionResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"digest":{"type":"string"}},"required":["digest"]}},"required":["data"]},"ExecuteSponsoredTransactionRequest":{"type":"object","properties":{"signature":{"type":"string","description":"User signature of the transaction."}},"required":["signature"]},"ZkLogin Response":{"type":"object","properties":{"data":{"type":"object","properties":{"salt":{"type":"string"},"address":{"type":"string"},"publicKey":{"type":"string"}},"required":["salt","address","publicKey"]}},"required":["data"]},"ZkLogin Addresses Response":{"type":"object","properties":{"data":{"type":"object","properties":{"addresses":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string"},"salt":{"type":"string"},"address":{"type":"string"},"publicKey":{"type":"string"},"legacy":{"type":"boolean"}},"required":["clientId","salt","address","publicKey"]}}},"required":["addresses"]}},"required":["data"]},"App Response":{"type":"object","properties":{"data":{"type":"object","properties":{"allowedOrigins":{"type":"array","items":{"type":"string"},"example":["https://example.com"]},"authenticationProviders":{"type":"array","items":{"type":"object","properties":{"providerType":{"type":"string","enum":["google","twitch","facebook","apple","karrier_one","credenza","playtron","onefc","fantv","cognito_trace","threedos","arden","evefrontier","test_evefrontier","cognito_gammaprime","cognito_test_gammaprime"]},"clientId":{"type":"string","nullable":true}},"required":["providerType","clientId"]},"example":[{"providerType":"google","clientId":"..."}]},"domains":{"type":"array","items":{"type":"object","properties":{"nftId":{"type":"string"},"name":{"type":"string"},"network":{"type":"string","enum":["testnet","mainnet"],"description":"The network the domain is registered on."}},"required":["nftId","name","network"]}}},"required":["allowedOrigins","authenticationProviders","domains"]}},"required":["data"]},"CreateSubnameResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string","enum":["PENDING","ACTIVE","FAILED"]},"createdAt":{"type":"string","format":"date-time","description":"The date and time the subname was created in ISO 8601 format","example":"2025-08-06T14:30:00.000Z"}},"required":["name","status","createdAt"]}},"required":["data"]},"CreateSubnameRequest":{"type":"object","properties":{"domain":{"type":"string","description":"The domain name to create the subname under."},"network":{"type":"string","enum":["testnet","mainnet"],"default":"mainnet","description":"The network the domain and subname are registered on."},"subname":{"type":"string","description":"The subname to create."},"targetAddress":{"type":"string","description":"The address the new subname will resolve to"}},"required":["domain","subname"]},"GetSubnamesResponse":{"type":"object","properties":{"data":{"type":"object","properties":{"subnames":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"status":{"type":"string","enum":["PENDING","ACTIVE"]},"createdAt":{"type":"string","format":"date-time","description":"The date and time the subname was created in ISO 8601 format","example":"2025-08-06T14:30:00.000Z"}},"required":["name","status","createdAt"]}}},"required":["subnames"]}},"required":["data"]}},"parameters":{}},"paths":{"/v1/zklogin/nonce":{"post":{"operationId":"createNonce","security":[{"apiKey":[]}],"summary":"Create zkLogin nonce","description":"Generates a nonce used in the zkLogin OAuth flow. Using this API is not required, you can also construct a nonce client-side if desired.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Nonce Request"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Nonce Response"}}}}}}},"/v1/zklogin/zkp":{"post":{"operationId":"createZkp","security":[{"apiKey":[]}],"summary":"Create zkLogin ZKP","description":"Creates a zero-knowledge proof, which is used to submit transactions to Sui.","parameters":[{"schema":{"type":"string","description":"The JWT of the user signed in with zkLogin."},"required":true,"name":"zklogin-jwt","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZKP Request"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZKP Response"}}}}}}},"/v1/transaction-blocks/sponsor":{"post":{"operationId":"createSponsoredTransaction","security":[{"apiKey":[]}],"summary":"Create sponsored transaction","description":"Creates sponsored transaction","parameters":[{"schema":{"type":"string","description":"The JWT of the user signed in with zkLogin."},"required":false,"name":"zklogin-jwt","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSponsoredTransactionRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSponsoredTransactionResponse"}}}}}}},"/v1/transaction-blocks/sponsor/{digest}":{"post":{"operationId":"executeSponsoredTransaction","security":[{"apiKey":[]}],"summary":"Submits a sponsored transaction for execution","description":"Submits a transaction created from `/transaction-blocks/sponsor` for execution.","parameters":[{"schema":{"type":"string","description":"The digest of the previously-created sponsored transaction block to execute."},"required":true,"description":"The digest of the previously-created sponsored transaction block to execute.","name":"digest","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteSponsoredTransactionRequest"}}}},"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExecuteSponsoredTransactionResponse"}}}}}}},"/v1/zklogin":{"get":{"operationId":"getZkLogin","security":[{"apiKey":[]}],"summary":"Get address for zkLogin user","description":"Returns the address and salt value for the given JWT. If the JWT is not valid, the API will return an error code.","parameters":[{"schema":{"type":"string","description":"The JWT of the user signed in with zkLogin."},"required":true,"name":"zklogin-jwt","in":"header"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZkLogin Response"}}}}}}},"/v1/zklogin/addresses":{"get":{"operationId":"getZkLoginAddresses","security":[{"apiKey":[]}],"tags":["experimental"],"summary":"Get addresses for zkLogin user","description":"Returns the addresses for a given JWT. If the JWT is not valid, the API will return an error code.","parameters":[{"schema":{"type":"string","description":"The JWT of the user signed in with zkLogin."},"required":true,"name":"zklogin-jwt","in":"header"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ZkLogin Addresses Response"}}}}}}},"/v1/app":{"get":{"operationId":"getApp","security":[{"apiKey":[]}],"summary":"Get app metadata","description":"Returns the public metadata (configured in the Enoki Developer Portal) of the app associated with the API key.","responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/App Response"}}}}}}},"/v1/subnames":{"post":{"operationId":"createSubname","security":[{"apiKey":[]}],"tags":["experimental"],"summary":"Create a subname","description":"Initiates the creation of a subname. The subname request is added to a processing queue and will be created asynchronously, typically within a few seconds. Note: A successful response from this API does not guarantee that the subname has been created yet. To check the status of the subname, use the `get` subname API or resolve the name directly on Sui.","parameters":[{"schema":{"type":"string","description":"The JWT of the user signed in with zkLogin."},"required":false,"name":"zklogin-jwt","in":"header"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubnameRequest"}}}},"responses":{"202":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubnameResponse"}}}}}},"delete":{"operationId":"deleteSubname","security":[{"apiKey":[]}],"tags":["experimental"],"summary":"Delete a subname","description":"Initiates the deletion of a subname. The subname request is added to a processing queue and will be deleted asynchronously, typically within a few seconds. Note: A successful response from this API does not guarantee that the subname has been deleted yet. To check the status of the subname, use the `get` subname API or resolve the name directly on Sui.","requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/CreateSubnameRequest"},{"properties":{"domain":{"type":"string","description":"The domain name the subname is on."},"network":{"type":"string","enum":["testnet","mainnet"],"default":"mainnet","description":"The network the domain and subname are registered on."},"subname":{"type":"string","description":"The subname to delete."}}}]}}}},"responses":{"202":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateSubnameResponse"}}}}}},"get":{"operationId":"getSubnames","tags":["experimental"],"security":[{"apiKey":[]}],"summary":"Get a list of subnames for an address","description":"Get a list of subnames for an address","parameters":[{"schema":{"type":"string","enum":["testnet","mainnet"],"default":"mainnet","description":"The network subnames are registered on."},"required":false,"description":"The network subnames are registered on.","name":"network","in":"query"},{"schema":{"type":"string","description":"The domain name the subname is on."},"required":false,"description":"The domain name the subname is on.","name":"domain","in":"query"},{"schema":{"type":"string","description":"The address to resolve subnames for"},"required":false,"description":"The address to resolve subnames for","name":"address","in":"query"}],"responses":{"200":{"description":"Successful response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetSubnamesResponse"}}}}}}}}}